You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +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:
@@ -752,7 +752,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
|
||||
|
||||
if (k.is_valid()) {
|
||||
if (k->is_pressed()) {
|
||||
if (k->get_scancode() == KEY_ESCAPE) {
|
||||
if (k->get_keycode() == KEY_ESCAPE) {
|
||||
|
||||
if (input_action == INPUT_PASTE) {
|
||||
_clear_clipboard_data();
|
||||
@@ -773,12 +773,12 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
|
||||
|
||||
if (k->get_shift() && selection.active && input_action != INPUT_PASTE) {
|
||||
|
||||
if (k->get_scancode() == options->get_popup()->get_item_accelerator(options->get_popup()->get_item_index(MENU_OPTION_PREV_LEVEL))) {
|
||||
if (k->get_keycode() == options->get_popup()->get_item_accelerator(options->get_popup()->get_item_index(MENU_OPTION_PREV_LEVEL))) {
|
||||
selection.click[edit_axis]--;
|
||||
_validate_selection();
|
||||
return true;
|
||||
}
|
||||
if (k->get_scancode() == options->get_popup()->get_item_accelerator(options->get_popup()->get_item_index(MENU_OPTION_NEXT_LEVEL))) {
|
||||
if (k->get_keycode() == options->get_popup()->get_item_accelerator(options->get_popup()->get_item_index(MENU_OPTION_NEXT_LEVEL))) {
|
||||
selection.click[edit_axis]++;
|
||||
_validate_selection();
|
||||
return true;
|
||||
@@ -842,7 +842,7 @@ void GridMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
|
||||
const 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)) {
|
||||
|
||||
// Forward the key input to the ItemList so it can be scrolled
|
||||
mesh_library_palette->call("_gui_input", k);
|
||||
|
||||
Reference in New Issue
Block a user