diff options
Diffstat (limited to 'core/os')
| -rw-r--r-- | core/os/input_event.cpp | 2 | ||||
| -rw-r--r-- | core/os/input_event.h | 8 | ||||
| -rw-r--r-- | core/os/keyboard.cpp | 22 | ||||
| -rw-r--r-- | core/os/main_loop.cpp | 1 | ||||
| -rw-r--r-- | core/os/os.h | 3 |
5 files changed, 30 insertions, 6 deletions
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index bef98ac3f2..6b43f2c63b 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -637,7 +637,7 @@ bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event) const if (jm.is_null()) return false; - return (axis == jm->axis && (axis_value < 0) == (jm->axis_value < 0)); + return (axis == jm->axis && ((axis_value < 0) == (jm->axis_value < 0) || jm->axis_value == 0)); } String InputEventJoypadMotion::as_text() const { diff --git a/core/os/input_event.h b/core/os/input_event.h index 5dc0f91d5f..de3c0232ff 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -44,7 +44,7 @@ * The events are pretty obvious. */ -enum { +enum ButtonList { BUTTON_LEFT = 1, BUTTON_RIGHT = 2, BUTTON_MIDDLE = 3, @@ -58,7 +58,7 @@ enum { }; -enum { +enum JoystickList { JOY_BUTTON_0 = 0, JOY_BUTTON_1 = 1, @@ -122,7 +122,9 @@ enum { JOY_AXIS_5 = 5, JOY_AXIS_6 = 6, JOY_AXIS_7 = 7, - JOY_AXIS_MAX = 8, + JOY_AXIS_8 = 8, + JOY_AXIS_9 = 9, + JOY_AXIS_MAX = 10, JOY_ANALOG_LX = JOY_AXIS_0, JOY_ANALOG_LY = JOY_AXIS_1, diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 30e7d5e791..edf4f3e2f9 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -505,6 +505,27 @@ static const _KeyCodeReplace _keycode_replace_neo[] = { { 0, 0 } }; +static const _KeyCodeReplace _keycode_replace_colemak[] = { + { KEY_E, KEY_F }, + { KEY_R, KEY_P }, + { KEY_T, KEY_G }, + { KEY_Y, KEY_J }, + { KEY_U, KEY_L }, + { KEY_I, KEY_U }, + { KEY_O, KEY_Y }, + { KEY_P, KEY_SEMICOLON }, + { KEY_S, KEY_R }, + { KEY_D, KEY_S }, + { KEY_F, KEY_T }, + { KEY_G, KEY_D }, + { KEY_J, KEY_N }, + { KEY_K, KEY_E }, + { KEY_L, KEY_I }, + { KEY_SEMICOLON, KEY_O }, + { KEY_N, KEY_K }, + { 0, 0 } +}; + int keycode_get_count() { const _KeyCodeText *kct = &_keycodes[0]; @@ -537,6 +558,7 @@ int latin_keyboard_keycode_convert(int p_keycode) { case OS::LATIN_KEYBOARD_QZERTY: kcr = _keycode_replace_qzerty; break; case OS::LATIN_KEYBOARD_DVORAK: kcr = _keycode_replace_dvorak; break; case OS::LATIN_KEYBOARD_NEO: kcr = _keycode_replace_neo; break; + case OS::LATIN_KEYBOARD_COLEMAK: kcr = _keycode_replace_colemak; break; default: return p_keycode; } diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index b146d370f1..8b4449586b 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -52,6 +52,7 @@ void MainLoop::_bind_methods() { BIND_CONSTANT(NOTIFICATION_WM_FOCUS_IN); BIND_CONSTANT(NOTIFICATION_WM_FOCUS_OUT); BIND_CONSTANT(NOTIFICATION_WM_QUIT_REQUEST); + BIND_CONSTANT(NOTIFICATION_WM_GO_BACK_REQUEST); BIND_CONSTANT(NOTIFICATION_WM_UNFOCUS_REQUEST); BIND_CONSTANT(NOTIFICATION_OS_MEMORY_WARNING); BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED); diff --git a/core/os/os.h b/core/os/os.h index 48effe99da..faecdb0e07 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -109,8 +109,6 @@ protected: virtual int get_video_driver_count() const = 0; virtual const char *get_video_driver_name(int p_driver) const = 0; - virtual VideoMode get_default_video_mode() const = 0; - virtual int get_audio_driver_count() const = 0; virtual const char *get_audio_driver_name(int p_driver) const = 0; @@ -409,6 +407,7 @@ public: LATIN_KEYBOARD_QZERTY, LATIN_KEYBOARD_DVORAK, LATIN_KEYBOARD_NEO, + LATIN_KEYBOARD_COLEMAK, }; virtual LatinKeyboardVariant get_latin_keyboard_variant() const; |