keebie/scripts/key_props.gd

24 lines
527 B
GDScript

class_name KeyProps
var physical_keycode: Key
var location: KeyLocation
var input_event: 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 = InputEventKey.new()
input_event.physical_keycode = physical_keycode
input_event.location = _location
width_ratio_init = _width_ratio
width_ratio = width_ratio_init