diff options
author | gregcsokas <gergo.csokas@gmail.com> | 2022-06-13 18:44:44 +0200 |
---|---|---|
committer | gregcsokas <gergo.csokas@gmail.com> | 2022-06-16 19:38:21 +0200 |
commit | 42e619c01e26bdf85f458a8f86498112adf2eee2 (patch) | |
tree | 85a999673d058522c96625563d0d278fa9c3b006 /core | |
parent | 1767507e69ac930f06ed073de49dc24e98124679 (diff) |
Adding function key support from F17 to F35
OSX supports everything by default,
Linux is also capable of supporting every function key,
Windows as I know support only up to F24
Diffstat (limited to 'core')
-rw-r--r-- | core/core_constants.cpp | 19 | ||||
-rw-r--r-- | core/os/keyboard.cpp | 38 | ||||
-rw-r--r-- | core/os/keyboard.h | 115 |
3 files changed, 124 insertions, 48 deletions
diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 4f22c99656..eb5a8226d7 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -213,6 +213,25 @@ void register_global_constants() { BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F14); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F15); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F16); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F17); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F18); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F19); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F20); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F21); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F22); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F23); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F24); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F25); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F26); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F27); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F28); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F29); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F30); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F31); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F32); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F33); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F34); + BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, F35); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_MULTIPLY); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_DIVIDE); BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, KP_SUBTRACT); diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 24907d34c8..3e690991d9 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -86,6 +86,25 @@ static const _KeyCodeText _keycodes[] = { {Key::F14 ,"F14"}, {Key::F15 ,"F15"}, {Key::F16 ,"F16"}, + {Key::F17 ,"F17"}, + {Key::F18 ,"F18"}, + {Key::F19 ,"F19"}, + {Key::F20 ,"F20"}, + {Key::F21 ,"F21"}, + {Key::F22 ,"F22"}, + {Key::F23 ,"F23"}, + {Key::F24 ,"F24"}, + {Key::F25 ,"F25"}, + {Key::F26 ,"F26"}, + {Key::F27 ,"F27"}, + {Key::F28 ,"F28"}, + {Key::F29 ,"F29"}, + {Key::F30 ,"F30"}, + {Key::F31 ,"F31"}, + {Key::F32 ,"F32"}, + {Key::F33 ,"F33"}, + {Key::F34 ,"F34"}, + {Key::F35 ,"F35"}, {Key::KP_MULTIPLY ,"Kp Multiply"}, {Key::KP_DIVIDE ,"Kp Divide"}, {Key::KP_SUBTRACT ,"Kp Subtract"}, @@ -333,6 +352,25 @@ bool keycode_has_unicode(Key p_keycode) { case Key::F14: case Key::F15: case Key::F16: + case Key::F17: + case Key::F18: + case Key::F19: + case Key::F20: + case Key::F21: + case Key::F22: + case Key::F23: + case Key::F24: + case Key::F25: + case Key::F26: + case Key::F27: + case Key::F28: + case Key::F29: + case Key::F30: + case Key::F31: + case Key::F32: + case Key::F33: + case Key::F34: + case Key::F35: case Key::SUPER_L: case Key::SUPER_R: case Key::MENU: diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 3176a8a210..517a53e505 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -85,6 +85,25 @@ enum class Key { F14 = SPECIAL | 0x29, F15 = SPECIAL | 0x2A, F16 = SPECIAL | 0x2B, + F17 = SPECIAL | 0x2C, + F18 = SPECIAL | 0x2D, + F19 = SPECIAL | 0x2E, + F20 = SPECIAL | 0x2F, + F21 = SPECIAL | 0x30, + F22 = SPECIAL | 0x31, + F23 = SPECIAL | 0x32, + F24 = SPECIAL | 0x33, + F25 = SPECIAL | 0x34, + F26 = SPECIAL | 0x35, + F27 = SPECIAL | 0x36, + F28 = SPECIAL | 0x37, + F29 = SPECIAL | 0x38, + F30 = SPECIAL | 0x39, + F31 = SPECIAL | 0x3A, + F32 = SPECIAL | 0x3B, + F33 = SPECIAL | 0x3C, + F34 = SPECIAL | 0x3D, + F35 = SPECIAL | 0x3E, KP_MULTIPLY = SPECIAL | 0x81, KP_DIVIDE = SPECIAL | 0x82, KP_SUBTRACT = SPECIAL | 0x83, @@ -100,54 +119,54 @@ enum class Key { KP_7 = SPECIAL | 0x8D, KP_8 = SPECIAL | 0x8E, KP_9 = SPECIAL | 0x8F, - SUPER_L = SPECIAL | 0x2C, - SUPER_R = SPECIAL | 0x2D, - MENU = SPECIAL | 0x2E, - HYPER_L = SPECIAL | 0x2F, - HYPER_R = SPECIAL | 0x30, - HELP = SPECIAL | 0x31, - DIRECTION_L = SPECIAL | 0x32, - DIRECTION_R = SPECIAL | 0x33, - BACK = SPECIAL | 0x40, - FORWARD = SPECIAL | 0x41, - STOP = SPECIAL | 0x42, - REFRESH = SPECIAL | 0x43, - VOLUMEDOWN = SPECIAL | 0x44, - VOLUMEMUTE = SPECIAL | 0x45, - VOLUMEUP = SPECIAL | 0x46, - BASSBOOST = SPECIAL | 0x47, - BASSUP = SPECIAL | 0x48, - BASSDOWN = SPECIAL | 0x49, - TREBLEUP = SPECIAL | 0x4A, - TREBLEDOWN = SPECIAL | 0x4B, - MEDIAPLAY = SPECIAL | 0x4C, - MEDIASTOP = SPECIAL | 0x4D, - MEDIAPREVIOUS = SPECIAL | 0x4E, - MEDIANEXT = SPECIAL | 0x4F, - MEDIARECORD = SPECIAL | 0x50, - HOMEPAGE = SPECIAL | 0x51, - FAVORITES = SPECIAL | 0x52, - SEARCH = SPECIAL | 0x53, - STANDBY = SPECIAL | 0x54, - OPENURL = SPECIAL | 0x55, - LAUNCHMAIL = SPECIAL | 0x56, - LAUNCHMEDIA = SPECIAL | 0x57, - LAUNCH0 = SPECIAL | 0x58, - LAUNCH1 = SPECIAL | 0x59, - LAUNCH2 = SPECIAL | 0x5A, - LAUNCH3 = SPECIAL | 0x5B, - LAUNCH4 = SPECIAL | 0x5C, - LAUNCH5 = SPECIAL | 0x5D, - LAUNCH6 = SPECIAL | 0x5E, - LAUNCH7 = SPECIAL | 0x5F, - LAUNCH8 = SPECIAL | 0x60, - LAUNCH9 = SPECIAL | 0x61, - LAUNCHA = SPECIAL | 0x62, - LAUNCHB = SPECIAL | 0x63, - LAUNCHC = SPECIAL | 0x64, - LAUNCHD = SPECIAL | 0x65, - LAUNCHE = SPECIAL | 0x66, - LAUNCHF = SPECIAL | 0x67, + SUPER_L = SPECIAL | 0x40, + SUPER_R = SPECIAL | 0x41, + MENU = SPECIAL | 0x42, + HYPER_L = SPECIAL | 0x43, + HYPER_R = SPECIAL | 0x44, + HELP = SPECIAL | 0x45, + DIRECTION_L = SPECIAL | 0x46, + DIRECTION_R = SPECIAL | 0x47, + BACK = SPECIAL | 0x48, + FORWARD = SPECIAL | 0x49, + STOP = SPECIAL | 0x4A, + REFRESH = SPECIAL | 0x4B, + VOLUMEDOWN = SPECIAL | 0x4C, + VOLUMEMUTE = SPECIAL | 0x4D, + VOLUMEUP = SPECIAL | 0x4E, + BASSBOOST = SPECIAL | 0x4F, + BASSUP = SPECIAL | 0x50, + BASSDOWN = SPECIAL | 0x51, + TREBLEUP = SPECIAL | 0x52, + TREBLEDOWN = SPECIAL | 0x53, + MEDIAPLAY = SPECIAL | 0x54, + MEDIASTOP = SPECIAL | 0x55, + MEDIAPREVIOUS = SPECIAL | 0x56, + MEDIANEXT = SPECIAL | 0x57, + MEDIARECORD = SPECIAL | 0x58, + HOMEPAGE = SPECIAL | 0x59, + FAVORITES = SPECIAL | 0x5A, + SEARCH = SPECIAL | 0x5B, + STANDBY = SPECIAL | 0x5C, + OPENURL = SPECIAL | 0x5D, + LAUNCHMAIL = SPECIAL | 0x5E, + LAUNCHMEDIA = SPECIAL | 0x5F, + LAUNCH0 = SPECIAL | 0x60, + LAUNCH1 = SPECIAL | 0x61, + LAUNCH2 = SPECIAL | 0x62, + LAUNCH3 = SPECIAL | 0x63, + LAUNCH4 = SPECIAL | 0x64, + LAUNCH5 = SPECIAL | 0x65, + LAUNCH6 = SPECIAL | 0x66, + LAUNCH7 = SPECIAL | 0x67, + LAUNCH8 = SPECIAL | 0x68, + LAUNCH9 = SPECIAL | 0x69, + LAUNCHA = SPECIAL | 0x6A, + LAUNCHB = SPECIAL | 0x6B, + LAUNCHC = SPECIAL | 0x6C, + LAUNCHD = SPECIAL | 0x6D, + LAUNCHE = SPECIAL | 0x6E, + LAUNCHF = SPECIAL | 0x6F, UNKNOWN = SPECIAL | 0xFFFFFF, |