30 lines
698 B
GDScript
30 lines
698 B
GDScript
class_name KeyProps
|
|
|
|
var physical_keycode: Key
|
|
var location: KeyLocation
|
|
|
|
var input_event_init: InputEventKey
|
|
var input_event_main: InputEventKey
|
|
var input_event_shift: InputEventKey
|
|
var input_event_alt: InputEventKey
|
|
var input_event_alt_shift: InputEventKey
|
|
|
|
var width_ratio_init: float
|
|
var width_ratio: float
|
|
|
|
|
|
func _init(
|
|
_physical_keycode: Key,
|
|
_width_ratio: float = 1,
|
|
_location: KeyLocation = KEY_LOCATION_UNSPECIFIED
|
|
) -> void:
|
|
physical_keycode = _physical_keycode
|
|
location = _location
|
|
|
|
input_event_init = InputEventKey.new()
|
|
input_event_init.physical_keycode = physical_keycode
|
|
input_event_init.location = _location
|
|
|
|
width_ratio_init = _width_ratio
|
|
width_ratio = width_ratio_init
|