1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Rename scancode to keycode.

Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
This commit is contained in:
bruvzg
2018-04-05 20:59:35 +03:00
parent 376a8255a9
commit 1af06d3d46
78 changed files with 736 additions and 299 deletions

View File

@@ -1904,7 +1904,7 @@ void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) {
// This is handled by the platform implementation on macOS,
// so only define the shortcut on other platforms
#ifndef OSX_ENABLED
if (k->get_scancode_with_modifiers() == (KEY_MASK_CMD | KEY_Q)) {
if (k->get_keycode_with_modifiers() == (KEY_MASK_CMD | KEY_Q)) {
_dim_window();
get_tree()->quit();
}
@@ -1913,9 +1913,9 @@ void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) {
if (tabs->get_current_tab() != 0)
return;
bool scancode_handled = true;
bool keycode_handled = true;
switch (k->get_scancode()) {
switch (k->get_keycode()) {
case KEY_ENTER: {
@@ -1972,14 +1972,14 @@ void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) {
if (k->get_command())
this->project_filter->search_box->grab_focus();
else
scancode_handled = false;
keycode_handled = false;
} break;
default: {
scancode_handled = false;
keycode_handled = false;
} break;
}
if (scancode_handled) {
if (keycode_handled) {
accept_event();
}
}