You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
This commit is contained in:
@@ -359,10 +359,10 @@ void TileMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_keycode() == KEY_UP ||
|
||||
k->get_keycode() == KEY_DOWN ||
|
||||
k->get_keycode() == KEY_PAGEUP ||
|
||||
k->get_keycode() == KEY_PAGEDOWN)) {
|
||||
|
||||
palette->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
@@ -1377,7 +1377,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
|
||||
|
||||
if (k.is_valid() && k->is_pressed()) {
|
||||
|
||||
if (last_tool == TOOL_NONE && tool == TOOL_PICKING && k->get_scancode() == KEY_SHIFT && k->get_command()) {
|
||||
if (last_tool == TOOL_NONE && tool == TOOL_PICKING && k->get_keycode() == KEY_SHIFT && k->get_command()) {
|
||||
// trying to draw a rectangle with the painting tool, so change to the correct tool
|
||||
tool = last_tool;
|
||||
|
||||
@@ -1385,7 +1385,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
|
||||
_update_button_tool();
|
||||
}
|
||||
|
||||
if (k->get_scancode() == KEY_ESCAPE) {
|
||||
if (k->get_keycode() == KEY_ESCAPE) {
|
||||
|
||||
if (tool == TOOL_PASTING)
|
||||
copydata.clear();
|
||||
@@ -1506,7 +1506,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
|
||||
|
||||
if (tool == TOOL_NONE) {
|
||||
|
||||
if (k->get_scancode() == KEY_SHIFT && k->get_command()) {
|
||||
if (k->get_keycode() == KEY_SHIFT && k->get_command()) {
|
||||
|
||||
tool = TOOL_PICKING;
|
||||
_update_button_tool();
|
||||
@@ -1514,9 +1514,9 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
|
||||
} else if (tool == TOOL_PICKING) {
|
||||
|
||||
#ifdef APPLE_STYLE_KEYS
|
||||
if (k->get_scancode() == KEY_META) {
|
||||
if (k->get_keycode() == KEY_META) {
|
||||
#else
|
||||
if (k->get_scancode() == KEY_CONTROL) {
|
||||
if (k->get_keycode() == KEY_CONTROL) {
|
||||
#endif
|
||||
// Go back to that last tool if KEY_CONTROL was released.
|
||||
tool = last_tool;
|
||||
|
||||
Reference in New Issue
Block a user