diff --git a/scripts/game_key.gd b/scripts/game_key.gd index 6a6d20d..cb0035e 100644 --- a/scripts/game_key.gd +++ b/scripts/game_key.gd @@ -64,12 +64,12 @@ static func instantiate_with_props( node.keyboard = _keyboard node.load_props(_props, init_pos, default_angle) - if _props.physical_keycode != KEY_SPECIAL: - node.name = node.name + " " + OS.get_keycode_string(_props.physical_keycode) - if _props.location != KEY_LOCATION_UNSPECIFIED: - node.name += ( - " " + ("Left" if _props.location == KEY_LOCATION_LEFT else "Right") - ) + if _props.physical_keycode != KEY_NONE: + node.name += " " + OS.get_keycode_string(_props.physical_keycode) + if _props.location != KEY_LOCATION_UNSPECIFIED: + node.name += ( + " " + ("Left" if _props.location == KEY_LOCATION_LEFT else "Right") + ) return node @@ -206,9 +206,6 @@ func _set_labels(chars_dict: Dictionary[KeyProps.Char, String] = {}) -> void: func _set_labels_text(chars_dict: Dictionary[KeyProps.Char, String]) -> void: - if props.physical_keycode == KEY_SPECIAL: - return - if not props.is_char(): _center_label.text = OS.get_keycode_string(props.physical_keycode) return diff --git a/scripts/globals/layout_config.gd b/scripts/globals/layout_config.gd index 9e05b4d..e955e01 100644 --- a/scripts/globals/layout_config.gd +++ b/scripts/globals/layout_config.gd @@ -14,11 +14,11 @@ var layout_rows: Array[Array] var is_configuring: bool = false var layouts: Dictionary[String, AbstractLayout] = { - # LayoutANSI.name: LayoutANSI.new(), - # LayoutANSIVariant.name: LayoutANSIVariant.new(), - # LayoutISO.name: LayoutISO.new(), - # LayoutABNT.name: LayoutABNT.new(), - # LayoutJIS.name: LayoutJIS.new(), + LayoutANSI.name: LayoutANSI.new(), + LayoutANSIVariant.name: LayoutANSIVariant.new(), + LayoutISO.name: LayoutISO.new(), + LayoutABNT.name: LayoutABNT.new(), + LayoutJIS.name: LayoutJIS.new(), # LayoutTest.name: LayoutTest.new(), } diff --git a/scripts/layouts/layout_abnt.gd b/scripts/layouts/layout_abnt.gd index e4ded29..7d78c39 100644 --- a/scripts/layouts/layout_abnt.gd +++ b/scripts/layouts/layout_abnt.gd @@ -31,7 +31,7 @@ func get_rows() -> Array[Array]: ] + CommonRows.letters_row_3() + [ - {KeyProps.KEY: KEY_UNKNOWN}, + {KeyProps.KEY: KEY_NONE}, { KeyProps.KEY: KEY_SHIFT, KeyProps.W: 1.75, diff --git a/scripts/layouts/layout_jis.gd b/scripts/layouts/layout_jis.gd index 96d71af..516aa41 100644 --- a/scripts/layouts/layout_jis.gd +++ b/scripts/layouts/layout_jis.gd @@ -11,7 +11,7 @@ func get_rows() -> Array[Array]: return [ ( CommonRows.number_row() - + [{KeyProps.KEY: KEY_UNKNOWN}, {KeyProps.KEY: KEY_BACKSPACE}] + + [{KeyProps.KEY: KEY_NONE}, {KeyProps.KEY: KEY_BACKSPACE}] ), ( [{KeyProps.KEY: KEY_TAB, KeyProps.W: 1.5}] @@ -33,7 +33,7 @@ func get_rows() -> Array[Array]: ] + CommonRows.letters_row_3() + [ - {KeyProps.KEY: KEY_UNKNOWN}, + {KeyProps.KEY: KEY_NONE}, { KeyProps.KEY: KEY_SHIFT, KeyProps.W: 1.75, @@ -45,10 +45,10 @@ func get_rows() -> Array[Array]: {KeyProps.KEY: KEY_CTRL, KeyProps.W: 1.25, KeyProps.LOC: KEY_LOCATION_LEFT}, {KeyProps.KEY: KEY_META, KeyProps.W: 1.25, KeyProps.LOC: KEY_LOCATION_LEFT}, {KeyProps.KEY: KEY_ALT, KeyProps.W: 1.25, KeyProps.LOC: KEY_LOCATION_LEFT}, - {KeyProps.KEY: KEY_SPECIAL, KeyProps.W: 1.25}, + {KeyProps.KEY: KEY_NONE, KeyProps.W: 1.25}, {KeyProps.KEY: KEY_SPACE, KeyProps.W: 2.5}, - {KeyProps.KEY: KEY_SPECIAL, KeyProps.W: 1.25}, - {KeyProps.KEY: KEY_SPECIAL, KeyProps.W: 1.25}, + {KeyProps.KEY: KEY_NONE, KeyProps.W: 1.25}, + {KeyProps.KEY: KEY_NONE, KeyProps.W: 1.25}, {KeyProps.KEY: KEY_ALT, KeyProps.W: 1.25, KeyProps.LOC: KEY_LOCATION_RIGHT}, { KeyProps.KEY: KEY_META, diff --git a/scripts/layouts/parser_kle.gd b/scripts/layouts/parser_kle.gd index dca62ef..b00c9af 100644 --- a/scripts/layouts/parser_kle.gd +++ b/scripts/layouts/parser_kle.gd @@ -42,7 +42,6 @@ const LABEL_TO_KEYCODE_MAP: Dictionary[String, Key] = { "Pause Break": KEY_PAUSE, "Page Down": KEY_PAGEDOWN, "Num Lock": KEY_NUMLOCK, - "Fn": KEY_SPECIAL, "↑": KEY_UP, "⇧": KEY_UP, "↑": KEY_UP, @@ -168,7 +167,6 @@ func _deserialize_row( var key_pos_dict := { KEY_DICT: key_dict, POS: Vector2(key_pos_rotated.x, key_pos_rotated.z) } - print(item as String, key_pos_dict) if key_pos_dicts.has(keycode): key_pos_dicts[keycode].append(key_pos_dict) @@ -293,7 +291,7 @@ func _get_key_locations(key_pos_dicts: Dictionary[Key, Array]) -> void: key_pos_dicts[KEY_BACKSLASH][0][KEY_DICT][KeyProps.KEY] = KEY_SECTION continue - if dicts.size() == 1: + if keycode == KEY_NONE or dicts.size() == 1: continue var key_pos_dict_left: Dictionary