Repository: geode-sdk/geode
Pull request #1258: Add handling of unused keys and mouse buttons, rewrite numpad input v2
Author: login: SpaghettDev
Created: 2025-03-04T03:29:50Z | Merged: 2025-03-11T20:16:34Z

Spiritual successor to #709. Adds Mac support. Extends Android keys.


Diff:
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index b0490d270..2c9801960 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -91,6 +91,8 @@ file(GLOB SOURCES CONFIGURE_DEPENDS
 file(GLOB OBJC_SOURCES
 	src/platform/Objcpp.mm
 	src/load.mm
+
+	src/hooks/AddExtraKeys.mm
 )
 set_source_files_properties(${OBJC_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
 
diff --git a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
index f8bf3db4f..02bd2685d 100644
--- a/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
+++ b/loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
@@ -14,7 +14,6 @@ NS_CC_BEGIN
 */
 typedef enum
 {
-    // this one might not actually exist in gd itself
     KEY_Unknown = -0x01,
     KEY_None = 0x00,
     KEY_Backspace = 0x08,
@@ -198,6 +197,28 @@ typedef enum
     CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
     CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
     CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
+
+    // Geode additions
+    KEY_GraveAccent = 0x1000,
+    KEY_OEMEqual = 0x1001,
+    KEY_LeftBracket = 0x1002,
+    KEY_RightBracket = 0x1003,
+    KEY_Backslash = 0x1004,
+    KEY_Semicolon = 0x1005,
+    KEY_Apostrophe = 0x1006,
+    KEY_Slash = 0x1007,
+    KEY_Equal = 0x1008,
+    KEY_NumEnter = 0x1009,
+    // Keys used by some non-US keyboard layouts
+    KEY_World1 = 0x100A,
+    KEY_World2 = 0x100B,
+
+    // Mouse buttons (excluding clicks)
+    MOUSE_4 = 0x1100,
+    MOUSE_5 = 0x1101,
+    MOUSE_6 = 0x1102,
+    MOUSE_7 = 0x1103,
+    MOUSE_8 = 0x1104
 } enumKeyCodes;
 
 // @note RobTop Addition
diff --git a/loader/src/hooks/AddExtraKeys.cpp b/loader/src/hooks/AddExtraKeys.cpp
new file mode 100644
index 000000000..eb0b6c217
--- /dev/null
+++ b/loader/src/hooks/AddExtraKeys.cpp
@@ -0,0 +1,206 @@
+#include <Geode/DefaultInclude.hpp>
+
+#ifdef GEODE_IS_WINDOWS
+#include <Geode/cocos/robtop/glfw/glfw3.h>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
+#include <Geode/cocos/text_input_node/CCIMEDispatcher.h>
+#include <Geode/modify/Modify.hpp>
+#include <Geode/modify/CCEGLView.hpp>
+#include <Geode/modify/CCKeyboardDispatcher.hpp>
+
+using namespace geode::prelude;
+
+class $modify(GeodeCCEGLView, CCEGLView) {
+    void onGLFWKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) {
+        bool extraKey = isExtraKey(key);
+        bool numpad = isKeyNumpad(key);
+        if (!extraKey && !numpad) {
+            return CCEGLView::onGLFWKeyCallback(window, key, scancode, action, mods);
+        }
+        if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+            return CCEGLView::onGLFWKeyCallback(window, key, scancode, action, mods);
+        }
+        bool down = action == 1 || action == 2;
+        bool repeat = action == 2;
+        enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+        if (extraKey) {
+            keyCode = this->extraKeyToKeyCode(key);
+        }
+        if (numpad) {
+            keyCode = this->numpadToKeyCode(key);
+        }
+        CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, down, repeat);
+    }
+
+    void onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int mods) {
+        if (!isExtraMouseButton(button)) {
+            return CCEGLView::onGLFWMouseCallBack(window, button, action, mods);
+        }
+        bool down = action == 1;
+        // mouse buttons never repeat
+        bool repeat = false;
+        enumKeyCodes keyCode = this->mouseButtonToKeyCode(button);
+        CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, down, repeat);
+    }
+
+    bool isExtraMouseButton(int code) {
+        return code > GLFW_MOUSE_BUTTON_3;
+    }
+
+    enumKeyCodes mouseButtonToKeyCode(int button) {
+        switch (button) {
+            case GLFW_MOUSE_BUTTON_4:
+                return enumKeyCodes::MOUSE_4;
+            case GLFW_MOUSE_BUTTON_5:
+                return enumKeyCodes::MOUSE_5;
+            case GLFW_MOUSE_BUTTON_6:
+                return enumKeyCodes::MOUSE_6;
+            case GLFW_MOUSE_BUTTON_7:
+                return enumKeyCodes::MOUSE_7;
+            case GLFW_MOUSE_BUTTON_8:
+                return enumKeyCodes::MOUSE_8; 
+            default:
+                return enumKeyCodes::KEY_Unknown;
+        }
+    }
+
+    bool isExtraKey(int code) {
+        switch (code) {
+            case GLFW_KEY_WORLD_1:
+            case GLFW_KEY_WORLD_2:
+            case GLFW_KEY_SEMICOLON:
+            case GLFW_KEY_APOSTROPHE:
+            case GLFW_KEY_SLASH:
+            case GLFW_KEY_EQUAL:
+            case GLFW_KEY_LEFT_BRACKET:
+            case GLFW_KEY_BACKSLASH:
+            case GLFW_KEY_RIGHT_BRACKET:
+            case GLFW_KEY_GRAVE_ACCENT:
+                return true;
+            default:
+                return false;
+        }
+    }
+
+    enumKeyCodes extraKeyToKeyCode(int key) {
+        switch (key) {
+            case GLFW_KEY_SEMICOLON:
+                return enumKeyCodes::KEY_Semicolon;
+            case GLFW_KEY_APOSTROPHE:
+                return enumKeyCodes::KEY_Apostrophe;
+            case GLFW_KEY_SLASH:
+                return enumKeyCodes::KEY_Slash;
+            case GLFW_KEY_EQUAL:
+                return enumKeyCodes::KEY_OEMEqual;
+            case GLFW_KEY_LEFT_BRACKET:
+                return enumKeyCodes::KEY_LeftBracket;
+            case GLFW_KEY_BACKSLASH:
+                return enumKeyCodes::KEY_Backslash;
+            case GLFW_KEY_RIGHT_BRACKET:
+                return enumKeyCodes::KEY_RightBracket;
+            case GLFW_KEY_GRAVE_ACCENT:
+                return enumKeyCodes::KEY_GraveAccent;
+            case GLFW_KEY_WORLD_1:
+                return enumKeyCodes::KEY_World1;
+            case GLFW_KEY_WORLD_2:
+                return enumKeyCodes::KEY_World2;
+            default:
+                return enumKeyCodes::KEY_Unknown;
+        }
+    }
+
+    bool isKeyNumpad(int code) {
+        return code >= GLFW_KEY_KP_0 && code <= GLFW_KEY_KP_EQUAL;
+    }
+
+    enumKeyCodes numpadToKeyCode(int key) {
+        switch (key) {
+            case GLFW_KEY_KP_0:
+                return enumKeyCodes::KEY_NumPad0;
+            case GLFW_KEY_KP_1:
+                return enumKeyCodes::KEY_NumPad1;
+            case GLFW_KEY_KP_2:
+                return enumKeyCodes::KEY_NumPad2;
+            case GLFW_KEY_KP_3:
+                return enumKeyCodes::KEY_NumPad3;
+            case GLFW_KEY_KP_4:
+                return enumKeyCodes::KEY_NumPad4;
+            case GLFW_KEY_KP_5:
+                return enumKeyCodes::KEY_NumPad5;
+            case GLFW_KEY_KP_6:
+                return enumKeyCodes::KEY_NumPad6;
+            case GLFW_KEY_KP_7:
+                return enumKeyCodes::KEY_NumPad7;
+            case GLFW_KEY_KP_8:
+                return enumKeyCodes::KEY_NumPad8;
+            case GLFW_KEY_KP_9:
+                return enumKeyCodes::KEY_NumPad9;
+            case GLFW_KEY_KP_DECIMAL:
+                return enumKeyCodes::KEY_Decimal;
+            case GLFW_KEY_KP_DIVIDE:
+                return enumKeyCodes::KEY_Divide;
+            case GLFW_KEY_KP_MULTIPLY:
+                return enumKeyCodes::KEY_Multiply;
+            case GLFW_KEY_KP_SUBTRACT:
+                return enumKeyCodes::KEY_Subtract;
+            case GLFW_KEY_KP_ADD:
+                return enumKeyCodes::KEY_Add;
+            case GLFW_KEY_KP_ENTER:
+                return enumKeyCodes::KEY_NumEnter;
+            case GLFW_KEY_KP_EQUAL:
+                return enumKeyCodes::KEY_Equal;
+            default:
+                return enumKeyCodes::KEY_Unknown;
+        }
+    }
+};
+
+class $modify(CCKeyboardDispatcher) {
+    GEODE_FORWARD_COMPAT_DISABLE_HOOKS("CCKeyboardDispatcher new keys")
+
+    const char* keyToString(enumKeyCodes key) {
+        if (key < 0x1000) {
+            return CCKeyboardDispatcher::keyToString(key);
+        }
+
+        switch (key) {
+            case KEY_GraveAccent:
+                return "`";
+            case KEY_OEMEqual:
+                return "=";
+            case KEY_LeftBracket:
+                return "[";
+            case KEY_RightBracket:
+                return "]";
+            case KEY_Backslash:
+                return "\\";
+            case KEY_Semicolon:
+                return ";";
+            case KEY_Apostrophe:
+                return "'";
+            case KEY_Slash:
+                return "/";
+            case KEY_NumEnter:
+                return "NumEnter";
+            case KEY_World1:
+                return "INTL-1";
+            case KEY_World2:
+                return "INTL-2";
+            case MOUSE_4:
+                return "Mouse 4";
+            case MOUSE_5:
+                return "Mouse 5";
+            case MOUSE_6:
+                return "Mouse 6";
+            case MOUSE_7:
+                return "Mouse 7";
+            case MOUSE_8:
+                return "Mouse 8";
+            default:
+                return CCKeyboardDispatcher::keyToString(KEY_Unknown);
+        }
+    }
+};
+
+#endif
\ No newline at end of file
diff --git a/loader/src/hooks/AddExtraKeys.mm b/loader/src/hooks/AddExtraKeys.mm
new file mode 100644
index 000000000..4159de471
--- /dev/null
+++ b/loader/src/hooks/AddExtraKeys.mm
@@ -0,0 +1,286 @@
+#include <Geode/DefaultInclude.hpp>
+
+#import <Cocoa/Cocoa.h>
+#include <objc/runtime.h>
+#include <Carbon/Carbon.h>
+
+#ifdef GEODE_IS_IOS
+#include <AppKit/AppKit.h>
+#endif
+
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
+#import <Geode/cocos/platform/mac/EAGLView.h>
+#include <Geode/cocos/text_input_node/CCIMEDispatcher.h>
+#include <Geode/modify/Modify.hpp>
+#include <Geode/modify/CCKeyboardDispatcher.hpp>
+
+using namespace geode::prelude;
+
+// https://github.com/SpaghettDev/BetterInputs/blob/44f249cd94f4cc19fca4de570dfab28f4efa3db8/src/platform/macos.mm#L121
+// we use this instead of [event keyCode] because the returned value of keyCode for letters is keyboard locale-specific
+int normalizedCodeFromEvent(NSEvent* event) {
+    if ([[event characters] length] > 0) {
+        return [[event characters] characterAtIndex:0];
+    } else if ([[event charactersIgnoringModifiers] length] > 0) {
+        return [[event charactersIgnoringModifiers] characterAtIndex:0];
+    }
+
+    return 0;
+}
+
+enumKeyCodes mouseButtonToKeyCode(NSEvent* event) {
+    switch ([event buttonNumber]) {
+        case 2:
+            return enumKeyCodes::MOUSE_4;
+        case 3:
+            return enumKeyCodes::MOUSE_5;
+        case 4:
+            return enumKeyCodes::MOUSE_6;
+        case 5:
+            return enumKeyCodes::MOUSE_7;
+        case 6:
+            return enumKeyCodes::MOUSE_8;
+        default:
+            return enumKeyCodes::KEY_Unknown;
+    }
+}
+
+bool isExtraMouseButton(NSEvent* event) {
+    return [event buttonNumber] > 1;
+}
+
+enumKeyCodes extraKeyToKeyCode(NSEvent* event) {
+    switch (normalizedCodeFromEvent(event)) {
+        case ';':
+            return enumKeyCodes::KEY_Semicolon;
+        case '\'':
+            return enumKeyCodes::KEY_Apostrophe;
+        case '/':
+            return enumKeyCodes::KEY_Slash;
+        case '=':
+            return enumKeyCodes::KEY_OEMEqual;
+        case '[':
+            return enumKeyCodes::KEY_LeftBracket;
+        case '\\':
+            return enumKeyCodes::KEY_Backslash;
+        case ']':
+            return enumKeyCodes::KEY_RightBracket;
+        case '`':
+            return enumKeyCodes::KEY_GraveAccent;
+        default:
+            break;
+    }
+
+    switch ([event keyCode]) {
+        case kVK_ISO_Section:
+            return enumKeyCodes::KEY_World2;
+        default:
+            break;
+    }
+
+    return enumKeyCodes::KEY_Unknown;
+}
+
+bool isExtraKey(NSEvent* event) {
+    return extraKeyToKeyCode(event) != enumKeyCodes::KEY_Unknown;
+}
+
+enumKeyCodes numpadToKeyCode(NSEvent* event) {
+    switch (normalizedCodeFromEvent(event)) {
+        case '0':
+            return enumKeyCodes::KEY_NumPad0;
+        case '1':
+            return enumKeyCodes::KEY_NumPad1;
+        case '2':
+            return enumKeyCodes::KEY_NumPad2;
+        case '3':
+            return enumKeyCodes::KEY_NumPad3;
+        case '4':
+            return enumKeyCodes::KEY_NumPad4;
+        case '5':
+            return enumKeyCodes::KEY_NumPad5;
+        case '6':
+            return enumKeyCodes::KEY_NumPad6;
+        case '7':
+            return enumKeyCodes::KEY_NumPad7;
+        case '8':
+            return enumKeyCodes::KEY_NumPad8;
+        case '9':
+            return enumKeyCodes::KEY_NumPad9;
+        case '.':
+            return enumKeyCodes::KEY_Decimal;
+        case '/':
+            return enumKeyCodes::KEY_Divide;
+        case '*':
+            return enumKeyCodes::KEY_Multiply;
+        case '-':
+            return enumKeyCodes::KEY_Subtract;
+        case '+':
+            return enumKeyCodes::KEY_Add;
+        case 3:
+            return enumKeyCodes::KEY_NumEnter;
+        case '=':
+            return enumKeyCodes::KEY_Equal;
+        default:
+            return enumKeyCodes::KEY_Unknown;
+    }
+}
+
+bool isKeyNumpad(NSEvent* event) {
+    return ([event modifierFlags] & NSEventModifierFlagNumericPad) != 0;
+}
+
+
+void keyDownExecHook(EAGLView* self, SEL sel, NSEvent* event) {
+    bool extraKey = isExtraKey(event);
+    bool numpad = isKeyNumpad(event);
+    if (!extraKey && !numpad) {
+        GEODE_MACOS([self performSelector:sel withObject:event]);
+        return;
+    }
+    if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+        GEODE_MACOS([self performSelector:sel withObject:event]);
+        return;
+    }
+
+    enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+    if (extraKey) {
+        keyCode = extraKeyToKeyCode(event);
+    }
+    if (numpad) {
+        keyCode = numpadToKeyCode(event);
+    }
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, [event isARepeat]);
+}
+
+void keyUpExecHook(EAGLView* self, SEL sel, NSEvent* event) {
+    bool extraKey = isExtraKey(event);
+    bool numpad = isKeyNumpad(event);
+    if (!extraKey && !numpad) {
+        GEODE_MACOS([self performSelector:sel withObject:event]);
+        return;
+    }
+    if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+        GEODE_MACOS([self performSelector:sel withObject:event]);
+        return;
+    }
+
+    enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+    if (extraKey) {
+        keyCode = extraKeyToKeyCode(event);
+    }
+    if (numpad) {
+        keyCode = numpadToKeyCode(event);
+    }
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, [event isARepeat]);
+}
+
+void mouseDownExecHook(EAGLView* self, SEL sel, NSEvent* event) {
+    if (!isExtraMouseButton(event)) {
+        GEODE_MACOS([self performSelector:sel withObject:event]);
+        return;
+    }
+
+    enumKeyCodes keyCode = mouseButtonToKeyCode(event);
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, false);
+}
+
+void mouseUpExecHook(EAGLView* self, SEL sel, NSEvent* event) {
+    if (!isExtraMouseButton(event)) {
+        GEODE_MACOS([self performSelector:sel withObject:event]);
+        return;
+    }
+
+    enumKeyCodes keyCode = mouseButtonToKeyCode(event);
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, false);
+}
+
+#ifdef GEODE_IS_MACOS
+class $modify(CCKeyboardDispatcher) {
+    GEODE_FORWARD_COMPAT_DISABLE_HOOKS("CCKeyboardDispatcher new keys")
+
+    const char* keyToString(enumKeyCodes key) {
+        if (key < 0x1000) {
+            return CCKeyboardDispatcher::keyToString(key);
+        }
+
+        switch (key) {
+            case KEY_GraveAccent:
+                return "`";
+            case KEY_OEMEqual:
+                return "=";
+            case KEY_LeftBracket:
+                return "[";
+            case KEY_RightBracket:
+                return "]";
+            case KEY_Backslash:
+                return "\\";
+            case KEY_Semicolon:
+                return ";";
+            case KEY_Apostrophe:
+                return "'";
+            case KEY_Slash:
+                return "/";
+            case KEY_NumEnter:
+                return "NumEnter";
+            case KEY_World1:
+                return "INTL-1";
+            case KEY_World2:
+                return "INTL-2";
+            case MOUSE_4:
+                return "Mouse 4";
+            case MOUSE_5:
+                return "Mouse 5";
+            case MOUSE_6:
+                return "Mouse 6";
+            case MOUSE_7:
+                return "Mouse 7";
+            case MOUSE_8:
+                return "Mouse 8";
+            default:
+                return CCKeyboardDispatcher::keyToString(KEY_Unknown);
+        }
+    }
+};
+#endif
+
+
+#define HOOK_OBJC_METHOD(klass, methodName) \
+    auto methodName##Addr = class_getInstanceMethod(klass, @selector(methodName:)); \
+    static_cast<void>(Mod::get()->hook(reinterpret_cast<void*>(method_getImplementation(methodName##Addr)), &methodName##Hook, #klass " " #methodName));
+
+__attribute__((constructor)) void initialize_newKeyboardMSGKeysHooks() {
+#if defined(GEODE_IS_MACOS)
+    auto eaglView = objc_getClass("EAGLView");
+
+    HOOK_OBJC_METHOD(eaglView, keyDownExec);
+    HOOK_OBJC_METHOD(eaglView, keyUpExec);
+
+    HOOK_OBJC_METHOD(eaglView, mouseDownExec);
+    HOOK_OBJC_METHOD(eaglView, mouseUpExec);
+#elif defined(GEODE_IS_IOS)
+    @autoreleasepool
+    {
+        [NSEvent addGlobalMonitorForEventsMatchingMask:NSEventTypeKeyDown handler: ^(NSEvent* event) {
+            keyDownExecHook(nullptr, 0, event);
+        }];
+        [NSEvent addGlobalMonitorForEventsMatchingMask:NSEventTypeKeyUp handler: ^(NSEvent* event) {
+            keyUpExecHook(nullptr, 0, event);
+        }];
+
+        [NSEvent
+            addGlobalMonitorForEventsMatchingMask:NSEventTypeLeftMouseDown | NSEventTypeRightMouseDown | NSEventTypeOtherMouseDown
+                handler: ^(NSEvent* event) {
+                    mouseDownExecHook(nullptr, 0, event);
+                }
+        ];
+        [NSEvent
+            addGlobalMonitorForEventsMatchingMask:NSEventTypeLeftMouseUp | NSEventTypeRightMouseUp | NSEventTypeOtherMouseUp
+                handler: ^(NSEvent* event) {
+                    mouseUpExecHook(nullptr, 0, event);
+                }
+        ];
+    }
+#endif
+}
diff --git a/loader/src/platform/android/input.cpp b/loader/src/platform/android/input.cpp
index 3bca3c8ed..f9d5fe0ba 100644
--- a/loader/src/platform/android/input.cpp
+++ b/loader/src/platform/android/input.cpp
@@ -84,6 +84,33 @@ namespace {
         {AKEYCODE_BUTTON_L1, cocos2d::CONTROLLER_LB},
         {AKEYCODE_BUTTON_R2, cocos2d::CONTROLLER_RT},
         {AKEYCODE_BUTTON_L2, cocos2d::CONTROLLER_LT},
+
+        // Geode Additions
+        {AKEYCODE_SEMICOLON, cocos2d::KEY_Semicolon},
+        {AKEYCODE_APOSTROPHE, cocos2d::KEY_Apostrophe},
+        {AKEYCODE_SLASH, cocos2d::KEY_Slash},
+        {AKEYCODE_EQUALS, cocos2d::KEY_OEMEqual},
+        {AKEYCODE_LEFT_BRACKET, cocos2d::KEY_LeftBracket},
+        {AKEYCODE_BACKSLASH, cocos2d::KEY_Backslash},
+        {AKEYCODE_RIGHT_BRACKET, cocos2d::KEY_RightBracket},
+        {AKEYCODE_GRAVE, cocos2d::KEY_GraveAccent},
+        {AKEYCODE_NUMPAD_0, cocos2d::KEY_NumPad0},
+        {AKEYCODE_NUMPAD_1, cocos2d::KEY_NumPad1},
+        {AKEYCODE_NUMPAD_2, cocos2d::KEY_NumPad2},
+        {AKEYCODE_NUMPAD_3, cocos2d::KEY_NumPad3},
+        {AKEYCODE_NUMPAD_4, cocos2d::KEY_NumPad4},
+        {AKEYCODE_NUMPAD_5, cocos2d::KEY_NumPad5},
+        {AKEYCODE_NUMPAD_6, cocos2d::KEY_NumPad6},
+        {AKEYCODE_NUMPAD_7, cocos2d::KEY_NumPad7},
+        {AKEYCODE_NUMPAD_8, cocos2d::KEY_NumPad8},
+        {AKEYCODE_NUMPAD_9, cocos2d::KEY_NumPad9},
+        {AKEYCODE_NUMPAD_DOT, cocos2d::KEY_Decimal},
+        {AKEYCODE_NUMPAD_DIVIDE, cocos2d::KEY_Divide},
+        {AKEYCODE_NUMPAD_MULTIPLY, cocos2d::KEY_Multiply},
+        {AKEYCODE_NUMPAD_SUBTRACT, cocos2d::KEY_Subtract},
+        {AKEYCODE_NUMPAD_ADD, cocos2d::KEY_Add},
+        {AKEYCODE_NUMPAD_ENTER, cocos2d::KEY_NumEnter},
+        {AKEYCODE_NUMPAD_EQUALS, cocos2d::KEY_Equal}
     };
 
     cocos2d::enumKeyCodes translateAndroidKeyCodeToWindows(int keyCode) {


Reviews:
user: login: matcool
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T21:59:31Z
user: login: SpaghettDev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T21:59:52Z
user: login: matcool
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T22:06:24Z
user: login: SpaghettDev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T22:08:41Z
user: login: matcool
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T23:14:04Z
user: login: qimiko
body: it didn't crash so i'm otherwise calling it good
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-05T01:52:40Z
user: login: SpaghettDev
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T03:23:06Z
user: login: qimiko
body: doesn't work on my iphone 17 air :frowning: 
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-07T03:10:55Z
user: login: matcool
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-08T16:02:17Z

Review comments:
diff_hunk: @@ -6,199 +6,220 @@
 
 NS_CC_BEGIN
 
-/*no clue if this is accurate.
-* https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
-* https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
-* not sure which one is which
-* @note RobTop Addition
-*/
-typedef enum
-{
-    // this one might not actually exist in gd itself
-    KEY_Unknown = -0x01,
-    KEY_None = 0x00,
-    KEY_Backspace = 0x08,
-    KEY_Tab = 0x09,
-    KEY_Clear = 0x0C,
-    KEY_Enter = 0x0D,
-    KEY_Shift = 0x10,
-    KEY_Control = 0x11,
-    KEY_Alt = 0x12,
-    KEY_Pause = 0x13,
-    KEY_CapsLock = 0x14,
-    KEY_Escape = 0x1B,
-    KEY_Space = 0x20,
-    KEY_PageUp = 0x21,
-    KEY_PageDown = 0x22,
-    KEY_End = 0x23,
-    KEY_Home = 0x24,
-    KEY_Left = 0x25,
-    KEY_Up = 0x26,
-    KEY_Right = 0x27,
-    KEY_Down = 0x28,
-    KEY_Select = 0x29,
-    KEY_Print = 0x2A,
-    KEY_Execute = 0x2B,
-    KEY_PrintScreen = 0x2C,
-    KEY_Insert = 0x2D,
-    KEY_Delete = 0x2E,
-    KEY_Help = 0x2F,
-    KEY_Zero = 0x30,
-    KEY_One = 0x31,
-    KEY_Two = 0x32,
-    KEY_Three = 0x33,
-    KEY_Four = 0x34,
-    KEY_Five = 0x35,
-    KEY_Six = 0x36,
-    KEY_Seven = 0x37,
-    KEY_Eight = 0x38,
-    KEY_Nine = 0x39,
-    KEY_A = 0x41,
-    KEY_B = 0x42,
-    KEY_C = 0x43,
-    KEY_D = 0x44,
-    KEY_E = 0x45,
-    KEY_F = 0x46,
-    KEY_G = 0x47,
-    KEY_H = 0x48,
-    KEY_I = 0x49,
-    KEY_J = 0x4A,
-    KEY_K = 0x4B,
-    KEY_L = 0x4C,
-    KEY_M = 0x4D,
-    KEY_N = 0x4E,
-    KEY_O = 0x4F,
-    KEY_P = 0x50,
-    KEY_Q = 0x51,
-    KEY_R = 0x52,
-    KEY_S = 0x53,
-    KEY_T = 0x54,
-    KEY_U = 0x55,
-    KEY_V = 0x56,
-    KEY_W = 0x57,
-    KEY_X = 0x58,
-    KEY_Y = 0x59,
-    KEY_Z = 0x5A,
-    KEY_LeftWindowsKey = 0x5B,
-    KEY_RightWindowsKey = 0x5C,
-    KEY_ApplicationsKey = 0x5D,
-    KEY_Sleep = 0x5F,
-    KEY_NumPad0 = 0x60,
-    KEY_NumPad1 = 0x61,
-    KEY_NumPad2 = 0x62,
-    KEY_NumPad3 = 0x63,
-    KEY_NumPad4 = 0x64,
-    KEY_NumPad5 = 0x65,
-    KEY_NumPad6 = 0x66,
-    KEY_NumPad7 = 0x67,
-    KEY_NumPad8 = 0x68,
-    KEY_NumPad9 = 0x69,
-    KEY_Multiply = 0x6A,
-    KEY_Add = 0x6B,
-    KEY_Seperator = 0x6C,
-    KEY_Subtract = 0x6D,
-    KEY_Decimal = 0x6E,
-    KEY_Divide = 0x6F,
-    KEY_F1 = 0x70,
-    KEY_F2 = 0x71,
-    KEY_F3 = 0x72,
-    KEY_F4 = 0x73,
-    KEY_F5 = 0x74,
-    KEY_F6 = 0x75,
-    KEY_F7 = 0x76,
-    KEY_F8 = 0x77,
-    KEY_F9 = 0x78,
-    KEY_F10 = 0x79,
-    KEY_F11 = 0x7A,
-    KEY_F12 = 0x7B,
-    KEY_F13 = 0x7C,
-    KEY_F14 = 0x7D,
-    KEY_F15 = 0x7E,
-    KEY_F16 = 0x7F,
-    KEY_F17 = 0x80,
-    KEY_F18 = 0x81,
-    KEY_F19 = 0x82,
-    KEY_F20 = 0x83,
-    KEY_F21 = 0x84,
-    KEY_F22 = 0x85,
-    KEY_F23 = 0x86,
-    KEY_F24 = 0x87,
-    KEY_Numlock = 0x90,
-    KEY_ScrollLock = 0x91,
-    KEY_LeftShift = 0xA0,
-    KEY_RightShift = 0xA1,
-    KEY_LeftControl = 0xA2,
-    KEY_RightContol = 0xA3,
-    KEY_LeftMenu = 0xA4,
-    KEY_RightMenu = 0xA5,
-    KEY_BrowserBack = 0xA6,
-    KEY_BrowserForward = 0xA7,
-    KEY_BrowserRefresh = 0xA8,
-    KEY_BrowserStop = 0xA9,
-    KEY_BrowserSearch = 0xAA,
-    KEY_BrowserFavorites = 0xAB,
-    KEY_BrowserHome = 0xAC,
-    KEY_VolumeMute = 0xAD,
-    KEY_VolumeDown = 0xAE,
-    KEY_VolumeUp = 0xAF,
-    KEY_NextTrack = 0xB0,
-    KEY_PreviousTrack = 0xB1,
-    KEY_StopMedia = 0xB2,
-    KEY_PlayPause = 0xB3,
-    KEY_LaunchMail = 0xB4,
-    KEY_SelectMedia = 0xB5,
-    KEY_LaunchApp1 = 0xB6,
-    KEY_LaunchApp2 = 0xB7,
-    KEY_OEM1 = 0xBA,
-    KEY_OEMPlus = 0xB8,
-    KEY_OEMComma = 0xBC,
-    KEY_OEMMinus = 0xBD,
-    KEY_OEMPeriod = 0xBE,
-    KEY_OEM2 = 0xBF,
-    KEY_OEM3 = 0xC0,
-    KEY_OEM4 = 0xDB,
-    KEY_OEM5 = 0xDC,
-    KEY_OEM6 = 0xDD,
-    KEY_OEM7 = 0xDE,
-    KEY_OEM8 = 0xDF,
-    KEY_OEM102 = 0xE2,
-    KEY_Process = 0xE5,
-    KEY_Packet = 0xE7,
-    KEY_Attn = 0xF6,
-    KEY_CrSel = 0xF7,
-    KEY_ExSel = 0xF8,
-    KEY_EraseEOF = 0xF9,
-    KEY_Play = 0xFA,
-    KEY_Zoom = 0xFB,
-    KEY_PA1 = 0xFD,
-    KEY_OEMClear = 0xFE,
-    KEY_ArrowUp = 0x11B,
-    KEY_ArrowDown = 0x11C,
-    KEY_ArrowLeft = 0x11D,
-    KEY_ArrowRight = 0x11E,
-    CONTROLLER_A = 0x3E9,
-    CONTROLLER_B = 0x3EB,
-    CONTROLLER_Y = 0x3ED,
-    CONTROLLER_X = 0x3EF,
-    CONTROLLER_Start = 0x3F1,
-    CONTROLLER_Back = 0x3F3,
-    CONTROLLER_RB = 0x3F5,
-    CONTROLLER_LB = 0x3F7,
-    CONTROLLER_RT = 0x3F9,
-    CONTROLLER_LT = 0x3FB,
-    CONTROLLER_Up = 0x3FD,
-    CONTROLLER_Down = 0x3FF,
-    CONTROLLER_Left = 0x401,
-    CONTROLLER_Right = 0x403,
-    CONTROLLER_LTHUMBSTICK_UP = 0x405,
-    CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
-    CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
-    CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
-    CONTROLLER_RTHUMBSTICK_UP = 0x40D,
-    CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
-    CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
-    CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
-} enumKeyCodes;
+    /*no clue if this is accurate.
+    * https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
+    * https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
+    * not sure which one is which
+    * @note RobTop Addition
+    */
+    typedef enum
+    {
+        KEY_Unknown = -0x01,
+        KEY_None = 0x00,
+        KEY_Backspace = 0x08,
+        KEY_Tab = 0x09,
+        KEY_Clear = 0x0C,
+        KEY_Enter = 0x0D,
+        KEY_Shift = 0x10,
+        KEY_Control = 0x11,
+        KEY_Alt = 0x12,
+        KEY_Pause = 0x13,
+        KEY_CapsLock = 0x14,
+        KEY_Escape = 0x1B,
+        KEY_Space = 0x20,
+        KEY_PageUp = 0x21,
+        KEY_PageDown = 0x22,
+        KEY_End = 0x23,
+        KEY_Home = 0x24,
+        KEY_Left = 0x25,
+        KEY_Up = 0x26,
+        KEY_Right = 0x27,
+        KEY_Down = 0x28,
+        KEY_Select = 0x29,
+        KEY_Print = 0x2A,
+        KEY_Execute = 0x2B,
+        KEY_PrintScreen = 0x2C,
+        KEY_Insert = 0x2D,
+        KEY_Delete = 0x2E,
+        KEY_Help = 0x2F,
+        KEY_Zero = 0x30,
+        KEY_One = 0x31,
+        KEY_Two = 0x32,
+        KEY_Three = 0x33,
+        KEY_Four = 0x34,
+        KEY_Five = 0x35,
+        KEY_Six = 0x36,
+        KEY_Seven = 0x37,
+        KEY_Eight = 0x38,
+        KEY_Nine = 0x39,
+        KEY_A = 0x41,
+        KEY_B = 0x42,
+        KEY_C = 0x43,
+        KEY_D = 0x44,
+        KEY_E = 0x45,
+        KEY_F = 0x46,
+        KEY_G = 0x47,
+        KEY_H = 0x48,
+        KEY_I = 0x49,
+        KEY_J = 0x4A,
+        KEY_K = 0x4B,
+        KEY_L = 0x4C,
+        KEY_M = 0x4D,
+        KEY_N = 0x4E,
+        KEY_O = 0x4F,
+        KEY_P = 0x50,
+        KEY_Q = 0x51,
+        KEY_R = 0x52,
+        KEY_S = 0x53,
+        KEY_T = 0x54,
+        KEY_U = 0x55,
+        KEY_V = 0x56,
+        KEY_W = 0x57,
+        KEY_X = 0x58,
+        KEY_Y = 0x59,
+        KEY_Z = 0x5A,
+        KEY_LeftWindowsKey = 0x5B,
+        KEY_RightWindowsKey = 0x5C,
+        KEY_ApplicationsKey = 0x5D,
+        KEY_Sleep = 0x5F,
+        KEY_NumPad0 = 0x60,
+        KEY_NumPad1 = 0x61,
+        KEY_NumPad2 = 0x62,
+        KEY_NumPad3 = 0x63,
+        KEY_NumPad4 = 0x64,
+        KEY_NumPad5 = 0x65,
+        KEY_NumPad6 = 0x66,
+        KEY_NumPad7 = 0x67,
+        KEY_NumPad8 = 0x68,
+        KEY_NumPad9 = 0x69,
+        KEY_Multiply = 0x6A,
+        KEY_Add = 0x6B,
+        KEY_Seperator = 0x6C,
+        KEY_Subtract = 0x6D,
+        KEY_Decimal = 0x6E,
+        KEY_Divide = 0x6F,
+        KEY_F1 = 0x70,
+        KEY_F2 = 0x71,
+        KEY_F3 = 0x72,
+        KEY_F4 = 0x73,
+        KEY_F5 = 0x74,
+        KEY_F6 = 0x75,
+        KEY_F7 = 0x76,
+        KEY_F8 = 0x77,
+        KEY_F9 = 0x78,
+        KEY_F10 = 0x79,
+        KEY_F11 = 0x7A,
+        KEY_F12 = 0x7B,
+        KEY_F13 = 0x7C,
+        KEY_F14 = 0x7D,
+        KEY_F15 = 0x7E,
+        KEY_F16 = 0x7F,
+        KEY_F17 = 0x80,
+        KEY_F18 = 0x81,
+        KEY_F19 = 0x82,
+        KEY_F20 = 0x83,
+        KEY_F21 = 0x84,
+        KEY_F22 = 0x85,
+        KEY_F23 = 0x86,
+        KEY_F24 = 0x87,
+        KEY_Numlock = 0x90,
+        KEY_ScrollLock = 0x91,
+        KEY_LeftShift = 0xA0,
+        KEY_RightShift = 0xA1,
+        KEY_LeftControl = 0xA2,
+        KEY_RightContol = 0xA3,
+        KEY_LeftMenu = 0xA4,
+        KEY_RightMenu = 0xA5,
+        KEY_BrowserBack = 0xA6,
+        KEY_BrowserForward = 0xA7,
+        KEY_BrowserRefresh = 0xA8,
+        KEY_BrowserStop = 0xA9,
+        KEY_BrowserSearch = 0xAA,
+        KEY_BrowserFavorites = 0xAB,
+        KEY_BrowserHome = 0xAC,
+        KEY_VolumeMute = 0xAD,
+        KEY_VolumeDown = 0xAE,
+        KEY_VolumeUp = 0xAF,
+        KEY_NextTrack = 0xB0,
+        KEY_PreviousTrack = 0xB1,
+        KEY_StopMedia = 0xB2,
+        KEY_PlayPause = 0xB3,
+        KEY_LaunchMail = 0xB4,
+        KEY_SelectMedia = 0xB5,
+        KEY_LaunchApp1 = 0xB6,
+        KEY_LaunchApp2 = 0xB7,
+        KEY_OEM1 = 0xBA,
+        KEY_OEMPlus = 0xB8,
+        KEY_OEMComma = 0xBC,
+        KEY_OEMMinus = 0xBD,
+        KEY_OEMPeriod = 0xBE,
+        KEY_OEM2 = 0xBF,
+        KEY_OEM3 = 0xC0,
+        KEY_OEM4 = 0xDB,
+        KEY_OEM5 = 0xDC,
+        KEY_OEM6 = 0xDD,
+        KEY_OEM7 = 0xDE,
+        KEY_OEM8 = 0xDF,
+        KEY_OEM102 = 0xE2,
+        KEY_Process = 0xE5,
+        KEY_Packet = 0xE7,
+        KEY_Attn = 0xF6,
+        KEY_CrSel = 0xF7,
+        KEY_ExSel = 0xF8,
+        KEY_EraseEOF = 0xF9,
+        KEY_Play = 0xFA,
+        KEY_Zoom = 0xFB,
+        KEY_PA1 = 0xFD,
+        KEY_OEMClear = 0xFE,
+        KEY_ArrowUp = 0x11B,
+        KEY_ArrowDown = 0x11C,
+        KEY_ArrowLeft = 0x11D,
+        KEY_ArrowRight = 0x11E,
+        CONTROLLER_A = 0x3E9,
+        CONTROLLER_B = 0x3EB,
+        CONTROLLER_Y = 0x3ED,
+        CONTROLLER_X = 0x3EF,
+        CONTROLLER_Start = 0x3F1,
+        CONTROLLER_Back = 0x3F3,
+        CONTROLLER_RB = 0x3F5,
+        CONTROLLER_LB = 0x3F7,
+        CONTROLLER_RT = 0x3F9,
+        CONTROLLER_LT = 0x3FB,
+        CONTROLLER_Up = 0x3FD,
+        CONTROLLER_Down = 0x3FF,
+        CONTROLLER_Left = 0x401,
+        CONTROLLER_Right = 0x403,
+        CONTROLLER_LTHUMBSTICK_UP = 0x405,
+        CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
+        CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
+        CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
+        CONTROLLER_RTHUMBSTICK_UP = 0x40D,
+        CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
+        CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
+        CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
+
+        // Geode additions
+        KEY_GraveAccent = 0x1000,
+        KEY_OEMEqual = 0x1001,
+        KEY_LeftBracket = 0x1002,
+        KEY_RightBracket = 0x1003,
+        KEY_Backslash = 0x1004,
+        KEY_Semicolon = 0x1005,
+        KEY_Apostrophe = 0x1006,
+        KEY_Slash = 0x1007,
+        KEY_Equal = 0x1008,
+        KEY_NumEnter = 0x1009,
+        // Keys used by some non-US keyboard layouts
+        KEY_World1 = 0x100A,
+        KEY_World2 = 0x100B,
+
+        // Mouse buttons (excluding clicks)
+        MOUSE_4 = 0x1100,
+        MOUSE_5 = 0x1101,
+        MOUSE_6 = 0x1102,
+        MOUSE_7 = 0x1103,
+        MOUSE_8 = 0x1104
+    } enumKeyCodes;
path: loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
user: login: matcool
body: why did you indent this whole enum
created_at: 2025-03-04T21:59:31Z
author_association: MEMBER
diff_hunk: @@ -6,199 +6,220 @@
 
 NS_CC_BEGIN
 
-/*no clue if this is accurate.
-* https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
-* https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
-* not sure which one is which
-* @note RobTop Addition
-*/
-typedef enum
-{
-    // this one might not actually exist in gd itself
-    KEY_Unknown = -0x01,
-    KEY_None = 0x00,
-    KEY_Backspace = 0x08,
-    KEY_Tab = 0x09,
-    KEY_Clear = 0x0C,
-    KEY_Enter = 0x0D,
-    KEY_Shift = 0x10,
-    KEY_Control = 0x11,
-    KEY_Alt = 0x12,
-    KEY_Pause = 0x13,
-    KEY_CapsLock = 0x14,
-    KEY_Escape = 0x1B,
-    KEY_Space = 0x20,
-    KEY_PageUp = 0x21,
-    KEY_PageDown = 0x22,
-    KEY_End = 0x23,
-    KEY_Home = 0x24,
-    KEY_Left = 0x25,
-    KEY_Up = 0x26,
-    KEY_Right = 0x27,
-    KEY_Down = 0x28,
-    KEY_Select = 0x29,
-    KEY_Print = 0x2A,
-    KEY_Execute = 0x2B,
-    KEY_PrintScreen = 0x2C,
-    KEY_Insert = 0x2D,
-    KEY_Delete = 0x2E,
-    KEY_Help = 0x2F,
-    KEY_Zero = 0x30,
-    KEY_One = 0x31,
-    KEY_Two = 0x32,
-    KEY_Three = 0x33,
-    KEY_Four = 0x34,
-    KEY_Five = 0x35,
-    KEY_Six = 0x36,
-    KEY_Seven = 0x37,
-    KEY_Eight = 0x38,
-    KEY_Nine = 0x39,
-    KEY_A = 0x41,
-    KEY_B = 0x42,
-    KEY_C = 0x43,
-    KEY_D = 0x44,
-    KEY_E = 0x45,
-    KEY_F = 0x46,
-    KEY_G = 0x47,
-    KEY_H = 0x48,
-    KEY_I = 0x49,
-    KEY_J = 0x4A,
-    KEY_K = 0x4B,
-    KEY_L = 0x4C,
-    KEY_M = 0x4D,
-    KEY_N = 0x4E,
-    KEY_O = 0x4F,
-    KEY_P = 0x50,
-    KEY_Q = 0x51,
-    KEY_R = 0x52,
-    KEY_S = 0x53,
-    KEY_T = 0x54,
-    KEY_U = 0x55,
-    KEY_V = 0x56,
-    KEY_W = 0x57,
-    KEY_X = 0x58,
-    KEY_Y = 0x59,
-    KEY_Z = 0x5A,
-    KEY_LeftWindowsKey = 0x5B,
-    KEY_RightWindowsKey = 0x5C,
-    KEY_ApplicationsKey = 0x5D,
-    KEY_Sleep = 0x5F,
-    KEY_NumPad0 = 0x60,
-    KEY_NumPad1 = 0x61,
-    KEY_NumPad2 = 0x62,
-    KEY_NumPad3 = 0x63,
-    KEY_NumPad4 = 0x64,
-    KEY_NumPad5 = 0x65,
-    KEY_NumPad6 = 0x66,
-    KEY_NumPad7 = 0x67,
-    KEY_NumPad8 = 0x68,
-    KEY_NumPad9 = 0x69,
-    KEY_Multiply = 0x6A,
-    KEY_Add = 0x6B,
-    KEY_Seperator = 0x6C,
-    KEY_Subtract = 0x6D,
-    KEY_Decimal = 0x6E,
-    KEY_Divide = 0x6F,
-    KEY_F1 = 0x70,
-    KEY_F2 = 0x71,
-    KEY_F3 = 0x72,
-    KEY_F4 = 0x73,
-    KEY_F5 = 0x74,
-    KEY_F6 = 0x75,
-    KEY_F7 = 0x76,
-    KEY_F8 = 0x77,
-    KEY_F9 = 0x78,
-    KEY_F10 = 0x79,
-    KEY_F11 = 0x7A,
-    KEY_F12 = 0x7B,
-    KEY_F13 = 0x7C,
-    KEY_F14 = 0x7D,
-    KEY_F15 = 0x7E,
-    KEY_F16 = 0x7F,
-    KEY_F17 = 0x80,
-    KEY_F18 = 0x81,
-    KEY_F19 = 0x82,
-    KEY_F20 = 0x83,
-    KEY_F21 = 0x84,
-    KEY_F22 = 0x85,
-    KEY_F23 = 0x86,
-    KEY_F24 = 0x87,
-    KEY_Numlock = 0x90,
-    KEY_ScrollLock = 0x91,
-    KEY_LeftShift = 0xA0,
-    KEY_RightShift = 0xA1,
-    KEY_LeftControl = 0xA2,
-    KEY_RightContol = 0xA3,
-    KEY_LeftMenu = 0xA4,
-    KEY_RightMenu = 0xA5,
-    KEY_BrowserBack = 0xA6,
-    KEY_BrowserForward = 0xA7,
-    KEY_BrowserRefresh = 0xA8,
-    KEY_BrowserStop = 0xA9,
-    KEY_BrowserSearch = 0xAA,
-    KEY_BrowserFavorites = 0xAB,
-    KEY_BrowserHome = 0xAC,
-    KEY_VolumeMute = 0xAD,
-    KEY_VolumeDown = 0xAE,
-    KEY_VolumeUp = 0xAF,
-    KEY_NextTrack = 0xB0,
-    KEY_PreviousTrack = 0xB1,
-    KEY_StopMedia = 0xB2,
-    KEY_PlayPause = 0xB3,
-    KEY_LaunchMail = 0xB4,
-    KEY_SelectMedia = 0xB5,
-    KEY_LaunchApp1 = 0xB6,
-    KEY_LaunchApp2 = 0xB7,
-    KEY_OEM1 = 0xBA,
-    KEY_OEMPlus = 0xB8,
-    KEY_OEMComma = 0xBC,
-    KEY_OEMMinus = 0xBD,
-    KEY_OEMPeriod = 0xBE,
-    KEY_OEM2 = 0xBF,
-    KEY_OEM3 = 0xC0,
-    KEY_OEM4 = 0xDB,
-    KEY_OEM5 = 0xDC,
-    KEY_OEM6 = 0xDD,
-    KEY_OEM7 = 0xDE,
-    KEY_OEM8 = 0xDF,
-    KEY_OEM102 = 0xE2,
-    KEY_Process = 0xE5,
-    KEY_Packet = 0xE7,
-    KEY_Attn = 0xF6,
-    KEY_CrSel = 0xF7,
-    KEY_ExSel = 0xF8,
-    KEY_EraseEOF = 0xF9,
-    KEY_Play = 0xFA,
-    KEY_Zoom = 0xFB,
-    KEY_PA1 = 0xFD,
-    KEY_OEMClear = 0xFE,
-    KEY_ArrowUp = 0x11B,
-    KEY_ArrowDown = 0x11C,
-    KEY_ArrowLeft = 0x11D,
-    KEY_ArrowRight = 0x11E,
-    CONTROLLER_A = 0x3E9,
-    CONTROLLER_B = 0x3EB,
-    CONTROLLER_Y = 0x3ED,
-    CONTROLLER_X = 0x3EF,
-    CONTROLLER_Start = 0x3F1,
-    CONTROLLER_Back = 0x3F3,
-    CONTROLLER_RB = 0x3F5,
-    CONTROLLER_LB = 0x3F7,
-    CONTROLLER_RT = 0x3F9,
-    CONTROLLER_LT = 0x3FB,
-    CONTROLLER_Up = 0x3FD,
-    CONTROLLER_Down = 0x3FF,
-    CONTROLLER_Left = 0x401,
-    CONTROLLER_Right = 0x403,
-    CONTROLLER_LTHUMBSTICK_UP = 0x405,
-    CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
-    CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
-    CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
-    CONTROLLER_RTHUMBSTICK_UP = 0x40D,
-    CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
-    CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
-    CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
-} enumKeyCodes;
+    /*no clue if this is accurate.
+    * https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
+    * https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
+    * not sure which one is which
+    * @note RobTop Addition
+    */
+    typedef enum
+    {
+        KEY_Unknown = -0x01,
+        KEY_None = 0x00,
+        KEY_Backspace = 0x08,
+        KEY_Tab = 0x09,
+        KEY_Clear = 0x0C,
+        KEY_Enter = 0x0D,
+        KEY_Shift = 0x10,
+        KEY_Control = 0x11,
+        KEY_Alt = 0x12,
+        KEY_Pause = 0x13,
+        KEY_CapsLock = 0x14,
+        KEY_Escape = 0x1B,
+        KEY_Space = 0x20,
+        KEY_PageUp = 0x21,
+        KEY_PageDown = 0x22,
+        KEY_End = 0x23,
+        KEY_Home = 0x24,
+        KEY_Left = 0x25,
+        KEY_Up = 0x26,
+        KEY_Right = 0x27,
+        KEY_Down = 0x28,
+        KEY_Select = 0x29,
+        KEY_Print = 0x2A,
+        KEY_Execute = 0x2B,
+        KEY_PrintScreen = 0x2C,
+        KEY_Insert = 0x2D,
+        KEY_Delete = 0x2E,
+        KEY_Help = 0x2F,
+        KEY_Zero = 0x30,
+        KEY_One = 0x31,
+        KEY_Two = 0x32,
+        KEY_Three = 0x33,
+        KEY_Four = 0x34,
+        KEY_Five = 0x35,
+        KEY_Six = 0x36,
+        KEY_Seven = 0x37,
+        KEY_Eight = 0x38,
+        KEY_Nine = 0x39,
+        KEY_A = 0x41,
+        KEY_B = 0x42,
+        KEY_C = 0x43,
+        KEY_D = 0x44,
+        KEY_E = 0x45,
+        KEY_F = 0x46,
+        KEY_G = 0x47,
+        KEY_H = 0x48,
+        KEY_I = 0x49,
+        KEY_J = 0x4A,
+        KEY_K = 0x4B,
+        KEY_L = 0x4C,
+        KEY_M = 0x4D,
+        KEY_N = 0x4E,
+        KEY_O = 0x4F,
+        KEY_P = 0x50,
+        KEY_Q = 0x51,
+        KEY_R = 0x52,
+        KEY_S = 0x53,
+        KEY_T = 0x54,
+        KEY_U = 0x55,
+        KEY_V = 0x56,
+        KEY_W = 0x57,
+        KEY_X = 0x58,
+        KEY_Y = 0x59,
+        KEY_Z = 0x5A,
+        KEY_LeftWindowsKey = 0x5B,
+        KEY_RightWindowsKey = 0x5C,
+        KEY_ApplicationsKey = 0x5D,
+        KEY_Sleep = 0x5F,
+        KEY_NumPad0 = 0x60,
+        KEY_NumPad1 = 0x61,
+        KEY_NumPad2 = 0x62,
+        KEY_NumPad3 = 0x63,
+        KEY_NumPad4 = 0x64,
+        KEY_NumPad5 = 0x65,
+        KEY_NumPad6 = 0x66,
+        KEY_NumPad7 = 0x67,
+        KEY_NumPad8 = 0x68,
+        KEY_NumPad9 = 0x69,
+        KEY_Multiply = 0x6A,
+        KEY_Add = 0x6B,
+        KEY_Seperator = 0x6C,
+        KEY_Subtract = 0x6D,
+        KEY_Decimal = 0x6E,
+        KEY_Divide = 0x6F,
+        KEY_F1 = 0x70,
+        KEY_F2 = 0x71,
+        KEY_F3 = 0x72,
+        KEY_F4 = 0x73,
+        KEY_F5 = 0x74,
+        KEY_F6 = 0x75,
+        KEY_F7 = 0x76,
+        KEY_F8 = 0x77,
+        KEY_F9 = 0x78,
+        KEY_F10 = 0x79,
+        KEY_F11 = 0x7A,
+        KEY_F12 = 0x7B,
+        KEY_F13 = 0x7C,
+        KEY_F14 = 0x7D,
+        KEY_F15 = 0x7E,
+        KEY_F16 = 0x7F,
+        KEY_F17 = 0x80,
+        KEY_F18 = 0x81,
+        KEY_F19 = 0x82,
+        KEY_F20 = 0x83,
+        KEY_F21 = 0x84,
+        KEY_F22 = 0x85,
+        KEY_F23 = 0x86,
+        KEY_F24 = 0x87,
+        KEY_Numlock = 0x90,
+        KEY_ScrollLock = 0x91,
+        KEY_LeftShift = 0xA0,
+        KEY_RightShift = 0xA1,
+        KEY_LeftControl = 0xA2,
+        KEY_RightContol = 0xA3,
+        KEY_LeftMenu = 0xA4,
+        KEY_RightMenu = 0xA5,
+        KEY_BrowserBack = 0xA6,
+        KEY_BrowserForward = 0xA7,
+        KEY_BrowserRefresh = 0xA8,
+        KEY_BrowserStop = 0xA9,
+        KEY_BrowserSearch = 0xAA,
+        KEY_BrowserFavorites = 0xAB,
+        KEY_BrowserHome = 0xAC,
+        KEY_VolumeMute = 0xAD,
+        KEY_VolumeDown = 0xAE,
+        KEY_VolumeUp = 0xAF,
+        KEY_NextTrack = 0xB0,
+        KEY_PreviousTrack = 0xB1,
+        KEY_StopMedia = 0xB2,
+        KEY_PlayPause = 0xB3,
+        KEY_LaunchMail = 0xB4,
+        KEY_SelectMedia = 0xB5,
+        KEY_LaunchApp1 = 0xB6,
+        KEY_LaunchApp2 = 0xB7,
+        KEY_OEM1 = 0xBA,
+        KEY_OEMPlus = 0xB8,
+        KEY_OEMComma = 0xBC,
+        KEY_OEMMinus = 0xBD,
+        KEY_OEMPeriod = 0xBE,
+        KEY_OEM2 = 0xBF,
+        KEY_OEM3 = 0xC0,
+        KEY_OEM4 = 0xDB,
+        KEY_OEM5 = 0xDC,
+        KEY_OEM6 = 0xDD,
+        KEY_OEM7 = 0xDE,
+        KEY_OEM8 = 0xDF,
+        KEY_OEM102 = 0xE2,
+        KEY_Process = 0xE5,
+        KEY_Packet = 0xE7,
+        KEY_Attn = 0xF6,
+        KEY_CrSel = 0xF7,
+        KEY_ExSel = 0xF8,
+        KEY_EraseEOF = 0xF9,
+        KEY_Play = 0xFA,
+        KEY_Zoom = 0xFB,
+        KEY_PA1 = 0xFD,
+        KEY_OEMClear = 0xFE,
+        KEY_ArrowUp = 0x11B,
+        KEY_ArrowDown = 0x11C,
+        KEY_ArrowLeft = 0x11D,
+        KEY_ArrowRight = 0x11E,
+        CONTROLLER_A = 0x3E9,
+        CONTROLLER_B = 0x3EB,
+        CONTROLLER_Y = 0x3ED,
+        CONTROLLER_X = 0x3EF,
+        CONTROLLER_Start = 0x3F1,
+        CONTROLLER_Back = 0x3F3,
+        CONTROLLER_RB = 0x3F5,
+        CONTROLLER_LB = 0x3F7,
+        CONTROLLER_RT = 0x3F9,
+        CONTROLLER_LT = 0x3FB,
+        CONTROLLER_Up = 0x3FD,
+        CONTROLLER_Down = 0x3FF,
+        CONTROLLER_Left = 0x401,
+        CONTROLLER_Right = 0x403,
+        CONTROLLER_LTHUMBSTICK_UP = 0x405,
+        CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
+        CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
+        CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
+        CONTROLLER_RTHUMBSTICK_UP = 0x40D,
+        CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
+        CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
+        CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
+
+        // Geode additions
+        KEY_GraveAccent = 0x1000,
+        KEY_OEMEqual = 0x1001,
+        KEY_LeftBracket = 0x1002,
+        KEY_RightBracket = 0x1003,
+        KEY_Backslash = 0x1004,
+        KEY_Semicolon = 0x1005,
+        KEY_Apostrophe = 0x1006,
+        KEY_Slash = 0x1007,
+        KEY_Equal = 0x1008,
+        KEY_NumEnter = 0x1009,
+        // Keys used by some non-US keyboard layouts
+        KEY_World1 = 0x100A,
+        KEY_World2 = 0x100B,
+
+        // Mouse buttons (excluding clicks)
+        MOUSE_4 = 0x1100,
+        MOUSE_5 = 0x1101,
+        MOUSE_6 = 0x1102,
+        MOUSE_7 = 0x1103,
+        MOUSE_8 = 0x1104
+    } enumKeyCodes;
path: loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
user: login: SpaghettDev
body: to match file indentation
created_at: 2025-03-04T21:59:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -6,199 +6,220 @@
 
 NS_CC_BEGIN
 
-/*no clue if this is accurate.
-* https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
-* https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
-* not sure which one is which
-* @note RobTop Addition
-*/
-typedef enum
-{
-    // this one might not actually exist in gd itself
-    KEY_Unknown = -0x01,
-    KEY_None = 0x00,
-    KEY_Backspace = 0x08,
-    KEY_Tab = 0x09,
-    KEY_Clear = 0x0C,
-    KEY_Enter = 0x0D,
-    KEY_Shift = 0x10,
-    KEY_Control = 0x11,
-    KEY_Alt = 0x12,
-    KEY_Pause = 0x13,
-    KEY_CapsLock = 0x14,
-    KEY_Escape = 0x1B,
-    KEY_Space = 0x20,
-    KEY_PageUp = 0x21,
-    KEY_PageDown = 0x22,
-    KEY_End = 0x23,
-    KEY_Home = 0x24,
-    KEY_Left = 0x25,
-    KEY_Up = 0x26,
-    KEY_Right = 0x27,
-    KEY_Down = 0x28,
-    KEY_Select = 0x29,
-    KEY_Print = 0x2A,
-    KEY_Execute = 0x2B,
-    KEY_PrintScreen = 0x2C,
-    KEY_Insert = 0x2D,
-    KEY_Delete = 0x2E,
-    KEY_Help = 0x2F,
-    KEY_Zero = 0x30,
-    KEY_One = 0x31,
-    KEY_Two = 0x32,
-    KEY_Three = 0x33,
-    KEY_Four = 0x34,
-    KEY_Five = 0x35,
-    KEY_Six = 0x36,
-    KEY_Seven = 0x37,
-    KEY_Eight = 0x38,
-    KEY_Nine = 0x39,
-    KEY_A = 0x41,
-    KEY_B = 0x42,
-    KEY_C = 0x43,
-    KEY_D = 0x44,
-    KEY_E = 0x45,
-    KEY_F = 0x46,
-    KEY_G = 0x47,
-    KEY_H = 0x48,
-    KEY_I = 0x49,
-    KEY_J = 0x4A,
-    KEY_K = 0x4B,
-    KEY_L = 0x4C,
-    KEY_M = 0x4D,
-    KEY_N = 0x4E,
-    KEY_O = 0x4F,
-    KEY_P = 0x50,
-    KEY_Q = 0x51,
-    KEY_R = 0x52,
-    KEY_S = 0x53,
-    KEY_T = 0x54,
-    KEY_U = 0x55,
-    KEY_V = 0x56,
-    KEY_W = 0x57,
-    KEY_X = 0x58,
-    KEY_Y = 0x59,
-    KEY_Z = 0x5A,
-    KEY_LeftWindowsKey = 0x5B,
-    KEY_RightWindowsKey = 0x5C,
-    KEY_ApplicationsKey = 0x5D,
-    KEY_Sleep = 0x5F,
-    KEY_NumPad0 = 0x60,
-    KEY_NumPad1 = 0x61,
-    KEY_NumPad2 = 0x62,
-    KEY_NumPad3 = 0x63,
-    KEY_NumPad4 = 0x64,
-    KEY_NumPad5 = 0x65,
-    KEY_NumPad6 = 0x66,
-    KEY_NumPad7 = 0x67,
-    KEY_NumPad8 = 0x68,
-    KEY_NumPad9 = 0x69,
-    KEY_Multiply = 0x6A,
-    KEY_Add = 0x6B,
-    KEY_Seperator = 0x6C,
-    KEY_Subtract = 0x6D,
-    KEY_Decimal = 0x6E,
-    KEY_Divide = 0x6F,
-    KEY_F1 = 0x70,
-    KEY_F2 = 0x71,
-    KEY_F3 = 0x72,
-    KEY_F4 = 0x73,
-    KEY_F5 = 0x74,
-    KEY_F6 = 0x75,
-    KEY_F7 = 0x76,
-    KEY_F8 = 0x77,
-    KEY_F9 = 0x78,
-    KEY_F10 = 0x79,
-    KEY_F11 = 0x7A,
-    KEY_F12 = 0x7B,
-    KEY_F13 = 0x7C,
-    KEY_F14 = 0x7D,
-    KEY_F15 = 0x7E,
-    KEY_F16 = 0x7F,
-    KEY_F17 = 0x80,
-    KEY_F18 = 0x81,
-    KEY_F19 = 0x82,
-    KEY_F20 = 0x83,
-    KEY_F21 = 0x84,
-    KEY_F22 = 0x85,
-    KEY_F23 = 0x86,
-    KEY_F24 = 0x87,
-    KEY_Numlock = 0x90,
-    KEY_ScrollLock = 0x91,
-    KEY_LeftShift = 0xA0,
-    KEY_RightShift = 0xA1,
-    KEY_LeftControl = 0xA2,
-    KEY_RightContol = 0xA3,
-    KEY_LeftMenu = 0xA4,
-    KEY_RightMenu = 0xA5,
-    KEY_BrowserBack = 0xA6,
-    KEY_BrowserForward = 0xA7,
-    KEY_BrowserRefresh = 0xA8,
-    KEY_BrowserStop = 0xA9,
-    KEY_BrowserSearch = 0xAA,
-    KEY_BrowserFavorites = 0xAB,
-    KEY_BrowserHome = 0xAC,
-    KEY_VolumeMute = 0xAD,
-    KEY_VolumeDown = 0xAE,
-    KEY_VolumeUp = 0xAF,
-    KEY_NextTrack = 0xB0,
-    KEY_PreviousTrack = 0xB1,
-    KEY_StopMedia = 0xB2,
-    KEY_PlayPause = 0xB3,
-    KEY_LaunchMail = 0xB4,
-    KEY_SelectMedia = 0xB5,
-    KEY_LaunchApp1 = 0xB6,
-    KEY_LaunchApp2 = 0xB7,
-    KEY_OEM1 = 0xBA,
-    KEY_OEMPlus = 0xB8,
-    KEY_OEMComma = 0xBC,
-    KEY_OEMMinus = 0xBD,
-    KEY_OEMPeriod = 0xBE,
-    KEY_OEM2 = 0xBF,
-    KEY_OEM3 = 0xC0,
-    KEY_OEM4 = 0xDB,
-    KEY_OEM5 = 0xDC,
-    KEY_OEM6 = 0xDD,
-    KEY_OEM7 = 0xDE,
-    KEY_OEM8 = 0xDF,
-    KEY_OEM102 = 0xE2,
-    KEY_Process = 0xE5,
-    KEY_Packet = 0xE7,
-    KEY_Attn = 0xF6,
-    KEY_CrSel = 0xF7,
-    KEY_ExSel = 0xF8,
-    KEY_EraseEOF = 0xF9,
-    KEY_Play = 0xFA,
-    KEY_Zoom = 0xFB,
-    KEY_PA1 = 0xFD,
-    KEY_OEMClear = 0xFE,
-    KEY_ArrowUp = 0x11B,
-    KEY_ArrowDown = 0x11C,
-    KEY_ArrowLeft = 0x11D,
-    KEY_ArrowRight = 0x11E,
-    CONTROLLER_A = 0x3E9,
-    CONTROLLER_B = 0x3EB,
-    CONTROLLER_Y = 0x3ED,
-    CONTROLLER_X = 0x3EF,
-    CONTROLLER_Start = 0x3F1,
-    CONTROLLER_Back = 0x3F3,
-    CONTROLLER_RB = 0x3F5,
-    CONTROLLER_LB = 0x3F7,
-    CONTROLLER_RT = 0x3F9,
-    CONTROLLER_LT = 0x3FB,
-    CONTROLLER_Up = 0x3FD,
-    CONTROLLER_Down = 0x3FF,
-    CONTROLLER_Left = 0x401,
-    CONTROLLER_Right = 0x403,
-    CONTROLLER_LTHUMBSTICK_UP = 0x405,
-    CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
-    CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
-    CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
-    CONTROLLER_RTHUMBSTICK_UP = 0x40D,
-    CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
-    CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
-    CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
-} enumKeyCodes;
+    /*no clue if this is accurate.
+    * https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
+    * https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
+    * not sure which one is which
+    * @note RobTop Addition
+    */
+    typedef enum
+    {
+        KEY_Unknown = -0x01,
+        KEY_None = 0x00,
+        KEY_Backspace = 0x08,
+        KEY_Tab = 0x09,
+        KEY_Clear = 0x0C,
+        KEY_Enter = 0x0D,
+        KEY_Shift = 0x10,
+        KEY_Control = 0x11,
+        KEY_Alt = 0x12,
+        KEY_Pause = 0x13,
+        KEY_CapsLock = 0x14,
+        KEY_Escape = 0x1B,
+        KEY_Space = 0x20,
+        KEY_PageUp = 0x21,
+        KEY_PageDown = 0x22,
+        KEY_End = 0x23,
+        KEY_Home = 0x24,
+        KEY_Left = 0x25,
+        KEY_Up = 0x26,
+        KEY_Right = 0x27,
+        KEY_Down = 0x28,
+        KEY_Select = 0x29,
+        KEY_Print = 0x2A,
+        KEY_Execute = 0x2B,
+        KEY_PrintScreen = 0x2C,
+        KEY_Insert = 0x2D,
+        KEY_Delete = 0x2E,
+        KEY_Help = 0x2F,
+        KEY_Zero = 0x30,
+        KEY_One = 0x31,
+        KEY_Two = 0x32,
+        KEY_Three = 0x33,
+        KEY_Four = 0x34,
+        KEY_Five = 0x35,
+        KEY_Six = 0x36,
+        KEY_Seven = 0x37,
+        KEY_Eight = 0x38,
+        KEY_Nine = 0x39,
+        KEY_A = 0x41,
+        KEY_B = 0x42,
+        KEY_C = 0x43,
+        KEY_D = 0x44,
+        KEY_E = 0x45,
+        KEY_F = 0x46,
+        KEY_G = 0x47,
+        KEY_H = 0x48,
+        KEY_I = 0x49,
+        KEY_J = 0x4A,
+        KEY_K = 0x4B,
+        KEY_L = 0x4C,
+        KEY_M = 0x4D,
+        KEY_N = 0x4E,
+        KEY_O = 0x4F,
+        KEY_P = 0x50,
+        KEY_Q = 0x51,
+        KEY_R = 0x52,
+        KEY_S = 0x53,
+        KEY_T = 0x54,
+        KEY_U = 0x55,
+        KEY_V = 0x56,
+        KEY_W = 0x57,
+        KEY_X = 0x58,
+        KEY_Y = 0x59,
+        KEY_Z = 0x5A,
+        KEY_LeftWindowsKey = 0x5B,
+        KEY_RightWindowsKey = 0x5C,
+        KEY_ApplicationsKey = 0x5D,
+        KEY_Sleep = 0x5F,
+        KEY_NumPad0 = 0x60,
+        KEY_NumPad1 = 0x61,
+        KEY_NumPad2 = 0x62,
+        KEY_NumPad3 = 0x63,
+        KEY_NumPad4 = 0x64,
+        KEY_NumPad5 = 0x65,
+        KEY_NumPad6 = 0x66,
+        KEY_NumPad7 = 0x67,
+        KEY_NumPad8 = 0x68,
+        KEY_NumPad9 = 0x69,
+        KEY_Multiply = 0x6A,
+        KEY_Add = 0x6B,
+        KEY_Seperator = 0x6C,
+        KEY_Subtract = 0x6D,
+        KEY_Decimal = 0x6E,
+        KEY_Divide = 0x6F,
+        KEY_F1 = 0x70,
+        KEY_F2 = 0x71,
+        KEY_F3 = 0x72,
+        KEY_F4 = 0x73,
+        KEY_F5 = 0x74,
+        KEY_F6 = 0x75,
+        KEY_F7 = 0x76,
+        KEY_F8 = 0x77,
+        KEY_F9 = 0x78,
+        KEY_F10 = 0x79,
+        KEY_F11 = 0x7A,
+        KEY_F12 = 0x7B,
+        KEY_F13 = 0x7C,
+        KEY_F14 = 0x7D,
+        KEY_F15 = 0x7E,
+        KEY_F16 = 0x7F,
+        KEY_F17 = 0x80,
+        KEY_F18 = 0x81,
+        KEY_F19 = 0x82,
+        KEY_F20 = 0x83,
+        KEY_F21 = 0x84,
+        KEY_F22 = 0x85,
+        KEY_F23 = 0x86,
+        KEY_F24 = 0x87,
+        KEY_Numlock = 0x90,
+        KEY_ScrollLock = 0x91,
+        KEY_LeftShift = 0xA0,
+        KEY_RightShift = 0xA1,
+        KEY_LeftControl = 0xA2,
+        KEY_RightContol = 0xA3,
+        KEY_LeftMenu = 0xA4,
+        KEY_RightMenu = 0xA5,
+        KEY_BrowserBack = 0xA6,
+        KEY_BrowserForward = 0xA7,
+        KEY_BrowserRefresh = 0xA8,
+        KEY_BrowserStop = 0xA9,
+        KEY_BrowserSearch = 0xAA,
+        KEY_BrowserFavorites = 0xAB,
+        KEY_BrowserHome = 0xAC,
+        KEY_VolumeMute = 0xAD,
+        KEY_VolumeDown = 0xAE,
+        KEY_VolumeUp = 0xAF,
+        KEY_NextTrack = 0xB0,
+        KEY_PreviousTrack = 0xB1,
+        KEY_StopMedia = 0xB2,
+        KEY_PlayPause = 0xB3,
+        KEY_LaunchMail = 0xB4,
+        KEY_SelectMedia = 0xB5,
+        KEY_LaunchApp1 = 0xB6,
+        KEY_LaunchApp2 = 0xB7,
+        KEY_OEM1 = 0xBA,
+        KEY_OEMPlus = 0xB8,
+        KEY_OEMComma = 0xBC,
+        KEY_OEMMinus = 0xBD,
+        KEY_OEMPeriod = 0xBE,
+        KEY_OEM2 = 0xBF,
+        KEY_OEM3 = 0xC0,
+        KEY_OEM4 = 0xDB,
+        KEY_OEM5 = 0xDC,
+        KEY_OEM6 = 0xDD,
+        KEY_OEM7 = 0xDE,
+        KEY_OEM8 = 0xDF,
+        KEY_OEM102 = 0xE2,
+        KEY_Process = 0xE5,
+        KEY_Packet = 0xE7,
+        KEY_Attn = 0xF6,
+        KEY_CrSel = 0xF7,
+        KEY_ExSel = 0xF8,
+        KEY_EraseEOF = 0xF9,
+        KEY_Play = 0xFA,
+        KEY_Zoom = 0xFB,
+        KEY_PA1 = 0xFD,
+        KEY_OEMClear = 0xFE,
+        KEY_ArrowUp = 0x11B,
+        KEY_ArrowDown = 0x11C,
+        KEY_ArrowLeft = 0x11D,
+        KEY_ArrowRight = 0x11E,
+        CONTROLLER_A = 0x3E9,
+        CONTROLLER_B = 0x3EB,
+        CONTROLLER_Y = 0x3ED,
+        CONTROLLER_X = 0x3EF,
+        CONTROLLER_Start = 0x3F1,
+        CONTROLLER_Back = 0x3F3,
+        CONTROLLER_RB = 0x3F5,
+        CONTROLLER_LB = 0x3F7,
+        CONTROLLER_RT = 0x3F9,
+        CONTROLLER_LT = 0x3FB,
+        CONTROLLER_Up = 0x3FD,
+        CONTROLLER_Down = 0x3FF,
+        CONTROLLER_Left = 0x401,
+        CONTROLLER_Right = 0x403,
+        CONTROLLER_LTHUMBSTICK_UP = 0x405,
+        CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
+        CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
+        CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
+        CONTROLLER_RTHUMBSTICK_UP = 0x40D,
+        CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
+        CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
+        CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
+
+        // Geode additions
+        KEY_GraveAccent = 0x1000,
+        KEY_OEMEqual = 0x1001,
+        KEY_LeftBracket = 0x1002,
+        KEY_RightBracket = 0x1003,
+        KEY_Backslash = 0x1004,
+        KEY_Semicolon = 0x1005,
+        KEY_Apostrophe = 0x1006,
+        KEY_Slash = 0x1007,
+        KEY_Equal = 0x1008,
+        KEY_NumEnter = 0x1009,
+        // Keys used by some non-US keyboard layouts
+        KEY_World1 = 0x100A,
+        KEY_World2 = 0x100B,
+
+        // Mouse buttons (excluding clicks)
+        MOUSE_4 = 0x1100,
+        MOUSE_5 = 0x1101,
+        MOUSE_6 = 0x1102,
+        MOUSE_7 = 0x1103,
+        MOUSE_8 = 0x1104
+    } enumKeyCodes;
path: loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
user: login: matcool
body: sorry its flame's fault actually in 619c597ee0a9d3a01ec247d6118f0e8ef6434125

u should undo it :P
created_at: 2025-03-04T22:06:24Z
author_association: MEMBER
diff_hunk: @@ -6,199 +6,220 @@
 
 NS_CC_BEGIN
 
-/*no clue if this is accurate.
-* https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
-* https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
-* not sure which one is which
-* @note RobTop Addition
-*/
-typedef enum
-{
-    // this one might not actually exist in gd itself
-    KEY_Unknown = -0x01,
-    KEY_None = 0x00,
-    KEY_Backspace = 0x08,
-    KEY_Tab = 0x09,
-    KEY_Clear = 0x0C,
-    KEY_Enter = 0x0D,
-    KEY_Shift = 0x10,
-    KEY_Control = 0x11,
-    KEY_Alt = 0x12,
-    KEY_Pause = 0x13,
-    KEY_CapsLock = 0x14,
-    KEY_Escape = 0x1B,
-    KEY_Space = 0x20,
-    KEY_PageUp = 0x21,
-    KEY_PageDown = 0x22,
-    KEY_End = 0x23,
-    KEY_Home = 0x24,
-    KEY_Left = 0x25,
-    KEY_Up = 0x26,
-    KEY_Right = 0x27,
-    KEY_Down = 0x28,
-    KEY_Select = 0x29,
-    KEY_Print = 0x2A,
-    KEY_Execute = 0x2B,
-    KEY_PrintScreen = 0x2C,
-    KEY_Insert = 0x2D,
-    KEY_Delete = 0x2E,
-    KEY_Help = 0x2F,
-    KEY_Zero = 0x30,
-    KEY_One = 0x31,
-    KEY_Two = 0x32,
-    KEY_Three = 0x33,
-    KEY_Four = 0x34,
-    KEY_Five = 0x35,
-    KEY_Six = 0x36,
-    KEY_Seven = 0x37,
-    KEY_Eight = 0x38,
-    KEY_Nine = 0x39,
-    KEY_A = 0x41,
-    KEY_B = 0x42,
-    KEY_C = 0x43,
-    KEY_D = 0x44,
-    KEY_E = 0x45,
-    KEY_F = 0x46,
-    KEY_G = 0x47,
-    KEY_H = 0x48,
-    KEY_I = 0x49,
-    KEY_J = 0x4A,
-    KEY_K = 0x4B,
-    KEY_L = 0x4C,
-    KEY_M = 0x4D,
-    KEY_N = 0x4E,
-    KEY_O = 0x4F,
-    KEY_P = 0x50,
-    KEY_Q = 0x51,
-    KEY_R = 0x52,
-    KEY_S = 0x53,
-    KEY_T = 0x54,
-    KEY_U = 0x55,
-    KEY_V = 0x56,
-    KEY_W = 0x57,
-    KEY_X = 0x58,
-    KEY_Y = 0x59,
-    KEY_Z = 0x5A,
-    KEY_LeftWindowsKey = 0x5B,
-    KEY_RightWindowsKey = 0x5C,
-    KEY_ApplicationsKey = 0x5D,
-    KEY_Sleep = 0x5F,
-    KEY_NumPad0 = 0x60,
-    KEY_NumPad1 = 0x61,
-    KEY_NumPad2 = 0x62,
-    KEY_NumPad3 = 0x63,
-    KEY_NumPad4 = 0x64,
-    KEY_NumPad5 = 0x65,
-    KEY_NumPad6 = 0x66,
-    KEY_NumPad7 = 0x67,
-    KEY_NumPad8 = 0x68,
-    KEY_NumPad9 = 0x69,
-    KEY_Multiply = 0x6A,
-    KEY_Add = 0x6B,
-    KEY_Seperator = 0x6C,
-    KEY_Subtract = 0x6D,
-    KEY_Decimal = 0x6E,
-    KEY_Divide = 0x6F,
-    KEY_F1 = 0x70,
-    KEY_F2 = 0x71,
-    KEY_F3 = 0x72,
-    KEY_F4 = 0x73,
-    KEY_F5 = 0x74,
-    KEY_F6 = 0x75,
-    KEY_F7 = 0x76,
-    KEY_F8 = 0x77,
-    KEY_F9 = 0x78,
-    KEY_F10 = 0x79,
-    KEY_F11 = 0x7A,
-    KEY_F12 = 0x7B,
-    KEY_F13 = 0x7C,
-    KEY_F14 = 0x7D,
-    KEY_F15 = 0x7E,
-    KEY_F16 = 0x7F,
-    KEY_F17 = 0x80,
-    KEY_F18 = 0x81,
-    KEY_F19 = 0x82,
-    KEY_F20 = 0x83,
-    KEY_F21 = 0x84,
-    KEY_F22 = 0x85,
-    KEY_F23 = 0x86,
-    KEY_F24 = 0x87,
-    KEY_Numlock = 0x90,
-    KEY_ScrollLock = 0x91,
-    KEY_LeftShift = 0xA0,
-    KEY_RightShift = 0xA1,
-    KEY_LeftControl = 0xA2,
-    KEY_RightContol = 0xA3,
-    KEY_LeftMenu = 0xA4,
-    KEY_RightMenu = 0xA5,
-    KEY_BrowserBack = 0xA6,
-    KEY_BrowserForward = 0xA7,
-    KEY_BrowserRefresh = 0xA8,
-    KEY_BrowserStop = 0xA9,
-    KEY_BrowserSearch = 0xAA,
-    KEY_BrowserFavorites = 0xAB,
-    KEY_BrowserHome = 0xAC,
-    KEY_VolumeMute = 0xAD,
-    KEY_VolumeDown = 0xAE,
-    KEY_VolumeUp = 0xAF,
-    KEY_NextTrack = 0xB0,
-    KEY_PreviousTrack = 0xB1,
-    KEY_StopMedia = 0xB2,
-    KEY_PlayPause = 0xB3,
-    KEY_LaunchMail = 0xB4,
-    KEY_SelectMedia = 0xB5,
-    KEY_LaunchApp1 = 0xB6,
-    KEY_LaunchApp2 = 0xB7,
-    KEY_OEM1 = 0xBA,
-    KEY_OEMPlus = 0xB8,
-    KEY_OEMComma = 0xBC,
-    KEY_OEMMinus = 0xBD,
-    KEY_OEMPeriod = 0xBE,
-    KEY_OEM2 = 0xBF,
-    KEY_OEM3 = 0xC0,
-    KEY_OEM4 = 0xDB,
-    KEY_OEM5 = 0xDC,
-    KEY_OEM6 = 0xDD,
-    KEY_OEM7 = 0xDE,
-    KEY_OEM8 = 0xDF,
-    KEY_OEM102 = 0xE2,
-    KEY_Process = 0xE5,
-    KEY_Packet = 0xE7,
-    KEY_Attn = 0xF6,
-    KEY_CrSel = 0xF7,
-    KEY_ExSel = 0xF8,
-    KEY_EraseEOF = 0xF9,
-    KEY_Play = 0xFA,
-    KEY_Zoom = 0xFB,
-    KEY_PA1 = 0xFD,
-    KEY_OEMClear = 0xFE,
-    KEY_ArrowUp = 0x11B,
-    KEY_ArrowDown = 0x11C,
-    KEY_ArrowLeft = 0x11D,
-    KEY_ArrowRight = 0x11E,
-    CONTROLLER_A = 0x3E9,
-    CONTROLLER_B = 0x3EB,
-    CONTROLLER_Y = 0x3ED,
-    CONTROLLER_X = 0x3EF,
-    CONTROLLER_Start = 0x3F1,
-    CONTROLLER_Back = 0x3F3,
-    CONTROLLER_RB = 0x3F5,
-    CONTROLLER_LB = 0x3F7,
-    CONTROLLER_RT = 0x3F9,
-    CONTROLLER_LT = 0x3FB,
-    CONTROLLER_Up = 0x3FD,
-    CONTROLLER_Down = 0x3FF,
-    CONTROLLER_Left = 0x401,
-    CONTROLLER_Right = 0x403,
-    CONTROLLER_LTHUMBSTICK_UP = 0x405,
-    CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
-    CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
-    CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
-    CONTROLLER_RTHUMBSTICK_UP = 0x40D,
-    CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
-    CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
-    CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
-} enumKeyCodes;
+    /*no clue if this is accurate.
+    * https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.13/cocos/base/CCEventKeyboard.h#L48
+    * https://github.com/reneklacan/cocos2d-x/wiki/Keyboard-keycodes-enum
+    * not sure which one is which
+    * @note RobTop Addition
+    */
+    typedef enum
+    {
+        KEY_Unknown = -0x01,
+        KEY_None = 0x00,
+        KEY_Backspace = 0x08,
+        KEY_Tab = 0x09,
+        KEY_Clear = 0x0C,
+        KEY_Enter = 0x0D,
+        KEY_Shift = 0x10,
+        KEY_Control = 0x11,
+        KEY_Alt = 0x12,
+        KEY_Pause = 0x13,
+        KEY_CapsLock = 0x14,
+        KEY_Escape = 0x1B,
+        KEY_Space = 0x20,
+        KEY_PageUp = 0x21,
+        KEY_PageDown = 0x22,
+        KEY_End = 0x23,
+        KEY_Home = 0x24,
+        KEY_Left = 0x25,
+        KEY_Up = 0x26,
+        KEY_Right = 0x27,
+        KEY_Down = 0x28,
+        KEY_Select = 0x29,
+        KEY_Print = 0x2A,
+        KEY_Execute = 0x2B,
+        KEY_PrintScreen = 0x2C,
+        KEY_Insert = 0x2D,
+        KEY_Delete = 0x2E,
+        KEY_Help = 0x2F,
+        KEY_Zero = 0x30,
+        KEY_One = 0x31,
+        KEY_Two = 0x32,
+        KEY_Three = 0x33,
+        KEY_Four = 0x34,
+        KEY_Five = 0x35,
+        KEY_Six = 0x36,
+        KEY_Seven = 0x37,
+        KEY_Eight = 0x38,
+        KEY_Nine = 0x39,
+        KEY_A = 0x41,
+        KEY_B = 0x42,
+        KEY_C = 0x43,
+        KEY_D = 0x44,
+        KEY_E = 0x45,
+        KEY_F = 0x46,
+        KEY_G = 0x47,
+        KEY_H = 0x48,
+        KEY_I = 0x49,
+        KEY_J = 0x4A,
+        KEY_K = 0x4B,
+        KEY_L = 0x4C,
+        KEY_M = 0x4D,
+        KEY_N = 0x4E,
+        KEY_O = 0x4F,
+        KEY_P = 0x50,
+        KEY_Q = 0x51,
+        KEY_R = 0x52,
+        KEY_S = 0x53,
+        KEY_T = 0x54,
+        KEY_U = 0x55,
+        KEY_V = 0x56,
+        KEY_W = 0x57,
+        KEY_X = 0x58,
+        KEY_Y = 0x59,
+        KEY_Z = 0x5A,
+        KEY_LeftWindowsKey = 0x5B,
+        KEY_RightWindowsKey = 0x5C,
+        KEY_ApplicationsKey = 0x5D,
+        KEY_Sleep = 0x5F,
+        KEY_NumPad0 = 0x60,
+        KEY_NumPad1 = 0x61,
+        KEY_NumPad2 = 0x62,
+        KEY_NumPad3 = 0x63,
+        KEY_NumPad4 = 0x64,
+        KEY_NumPad5 = 0x65,
+        KEY_NumPad6 = 0x66,
+        KEY_NumPad7 = 0x67,
+        KEY_NumPad8 = 0x68,
+        KEY_NumPad9 = 0x69,
+        KEY_Multiply = 0x6A,
+        KEY_Add = 0x6B,
+        KEY_Seperator = 0x6C,
+        KEY_Subtract = 0x6D,
+        KEY_Decimal = 0x6E,
+        KEY_Divide = 0x6F,
+        KEY_F1 = 0x70,
+        KEY_F2 = 0x71,
+        KEY_F3 = 0x72,
+        KEY_F4 = 0x73,
+        KEY_F5 = 0x74,
+        KEY_F6 = 0x75,
+        KEY_F7 = 0x76,
+        KEY_F8 = 0x77,
+        KEY_F9 = 0x78,
+        KEY_F10 = 0x79,
+        KEY_F11 = 0x7A,
+        KEY_F12 = 0x7B,
+        KEY_F13 = 0x7C,
+        KEY_F14 = 0x7D,
+        KEY_F15 = 0x7E,
+        KEY_F16 = 0x7F,
+        KEY_F17 = 0x80,
+        KEY_F18 = 0x81,
+        KEY_F19 = 0x82,
+        KEY_F20 = 0x83,
+        KEY_F21 = 0x84,
+        KEY_F22 = 0x85,
+        KEY_F23 = 0x86,
+        KEY_F24 = 0x87,
+        KEY_Numlock = 0x90,
+        KEY_ScrollLock = 0x91,
+        KEY_LeftShift = 0xA0,
+        KEY_RightShift = 0xA1,
+        KEY_LeftControl = 0xA2,
+        KEY_RightContol = 0xA3,
+        KEY_LeftMenu = 0xA4,
+        KEY_RightMenu = 0xA5,
+        KEY_BrowserBack = 0xA6,
+        KEY_BrowserForward = 0xA7,
+        KEY_BrowserRefresh = 0xA8,
+        KEY_BrowserStop = 0xA9,
+        KEY_BrowserSearch = 0xAA,
+        KEY_BrowserFavorites = 0xAB,
+        KEY_BrowserHome = 0xAC,
+        KEY_VolumeMute = 0xAD,
+        KEY_VolumeDown = 0xAE,
+        KEY_VolumeUp = 0xAF,
+        KEY_NextTrack = 0xB0,
+        KEY_PreviousTrack = 0xB1,
+        KEY_StopMedia = 0xB2,
+        KEY_PlayPause = 0xB3,
+        KEY_LaunchMail = 0xB4,
+        KEY_SelectMedia = 0xB5,
+        KEY_LaunchApp1 = 0xB6,
+        KEY_LaunchApp2 = 0xB7,
+        KEY_OEM1 = 0xBA,
+        KEY_OEMPlus = 0xB8,
+        KEY_OEMComma = 0xBC,
+        KEY_OEMMinus = 0xBD,
+        KEY_OEMPeriod = 0xBE,
+        KEY_OEM2 = 0xBF,
+        KEY_OEM3 = 0xC0,
+        KEY_OEM4 = 0xDB,
+        KEY_OEM5 = 0xDC,
+        KEY_OEM6 = 0xDD,
+        KEY_OEM7 = 0xDE,
+        KEY_OEM8 = 0xDF,
+        KEY_OEM102 = 0xE2,
+        KEY_Process = 0xE5,
+        KEY_Packet = 0xE7,
+        KEY_Attn = 0xF6,
+        KEY_CrSel = 0xF7,
+        KEY_ExSel = 0xF8,
+        KEY_EraseEOF = 0xF9,
+        KEY_Play = 0xFA,
+        KEY_Zoom = 0xFB,
+        KEY_PA1 = 0xFD,
+        KEY_OEMClear = 0xFE,
+        KEY_ArrowUp = 0x11B,
+        KEY_ArrowDown = 0x11C,
+        KEY_ArrowLeft = 0x11D,
+        KEY_ArrowRight = 0x11E,
+        CONTROLLER_A = 0x3E9,
+        CONTROLLER_B = 0x3EB,
+        CONTROLLER_Y = 0x3ED,
+        CONTROLLER_X = 0x3EF,
+        CONTROLLER_Start = 0x3F1,
+        CONTROLLER_Back = 0x3F3,
+        CONTROLLER_RB = 0x3F5,
+        CONTROLLER_LB = 0x3F7,
+        CONTROLLER_RT = 0x3F9,
+        CONTROLLER_LT = 0x3FB,
+        CONTROLLER_Up = 0x3FD,
+        CONTROLLER_Down = 0x3FF,
+        CONTROLLER_Left = 0x401,
+        CONTROLLER_Right = 0x403,
+        CONTROLLER_LTHUMBSTICK_UP = 0x405,
+        CONTROLLER_LTHUMBSTICK_DOWN = 0x407,
+        CONTROLLER_LTHUMBSTICK_LEFT = 0x409,
+        CONTROLLER_LTHUMBSTICK_RIGHT = 0x40B,
+        CONTROLLER_RTHUMBSTICK_UP = 0x40D,
+        CONTROLLER_RTHUMBSTICK_DOWN = 0x40F,
+        CONTROLLER_RTHUMBSTICK_LEFT = 0x411,
+        CONTROLLER_RTHUMBSTICK_RIGHT = 0x413,
+
+        // Geode additions
+        KEY_GraveAccent = 0x1000,
+        KEY_OEMEqual = 0x1001,
+        KEY_LeftBracket = 0x1002,
+        KEY_RightBracket = 0x1003,
+        KEY_Backslash = 0x1004,
+        KEY_Semicolon = 0x1005,
+        KEY_Apostrophe = 0x1006,
+        KEY_Slash = 0x1007,
+        KEY_Equal = 0x1008,
+        KEY_NumEnter = 0x1009,
+        // Keys used by some non-US keyboard layouts
+        KEY_World1 = 0x100A,
+        KEY_World2 = 0x100B,
+
+        // Mouse buttons (excluding clicks)
+        MOUSE_4 = 0x1100,
+        MOUSE_5 = 0x1101,
+        MOUSE_6 = 0x1102,
+        MOUSE_7 = 0x1103,
+        MOUSE_8 = 0x1104
+    } enumKeyCodes;
path: loader/include/Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h
user: login: SpaghettDev
body: alright
created_at: 2025-03-04T22:08:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,206 @@
+#ifdef GEODE_IS_WINDOWS
path: loader/src/hooks/AddExtraKeys.cpp
user: login: matcool
body: relying on pch 💔 silly flame
created_at: 2025-03-04T23:14:04Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,253 @@
+#import <Cocoa/Cocoa.h>
+#include <objc/runtime.h>
+#include <Carbon/Carbon.h>
+
+#include <Geode/DefaultInclude.hpp>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
+#include <Geode/cocos/text_input_node/CCIMEDispatcher.h>
+#include <Geode/modify/Modify.hpp>
+#include <Geode/modify/CCKeyboardDispatcher.hpp>
+
+using namespace geode::prelude;
+
+// https://github.com/SpaghettDev/BetterInputs/blob/44f249cd94f4cc19fca4de570dfab28f4efa3db8/src/platform/macos.mm#L121
+// we use this instead of [event keyCode] because the returned value of keyCode for letters is keyboard locale-specific
+int normalizedCodeFromEvent(NSEvent* event) {
+    if ([[event characters] length] > 0) {
+        return [[event characters] characterAtIndex:0];
+    } else if ([[event charactersIgnoringModifiers] length] > 0) {
+        return [[event charactersIgnoringModifiers] characterAtIndex:0];
+    }
+
+    return 0;
+}
+
+enumKeyCodes mouseButtonToKeyCode(NSEvent* event) {
+    switch ([event buttonNumber]) {
+        case 2:
+            return enumKeyCodes::MOUSE_4;
+        case 3:
+            return enumKeyCodes::MOUSE_5;
+        case 4:
+            return enumKeyCodes::MOUSE_6;
+        case 5:
+            return enumKeyCodes::MOUSE_7;
+        case 6:
+            return enumKeyCodes::MOUSE_8;
+        default:
+            return enumKeyCodes::KEY_Unknown;
+    }
+}
+
+bool isExtraMouseButton(NSEvent* event) {
+    return [event buttonNumber] > 1;
+}
+
+enumKeyCodes extraKeyToKeyCode(NSEvent* event) {
+    switch (normalizedCodeFromEvent(event)) {
+        case ';':
+            return enumKeyCodes::KEY_Semicolon;
+        case '\'':
+            return enumKeyCodes::KEY_Apostrophe;
+        case '/':
+            return enumKeyCodes::KEY_Slash;
+        case '=':
+            return enumKeyCodes::KEY_OEMEqual;
+        case '[':
+            return enumKeyCodes::KEY_LeftBracket;
+        case '\\':
+            return enumKeyCodes::KEY_Backslash;
+        case ']':
+            return enumKeyCodes::KEY_RightBracket;
+        case '`':
+            return enumKeyCodes::KEY_GraveAccent;
+        default:
+            break;
+    }
+
+    switch ([event keyCode]) {
+        case kVK_ISO_Section:
+            return enumKeyCodes::KEY_World2;
+        default:
+            break;
+    }
+
+    return enumKeyCodes::KEY_Unknown;
+}
+
+bool isExtraKey(NSEvent* event) {
+    return extraKeyToKeyCode(event) != enumKeyCodes::KEY_Unknown;
+}
+
+enumKeyCodes numpadToKeyCode(NSEvent* event) {
+    switch (normalizedCodeFromEvent(event)) {
+        case '0':
+            return enumKeyCodes::KEY_NumPad0;
+        case '1':
+            return enumKeyCodes::KEY_NumPad1;
+        case '2':
+            return enumKeyCodes::KEY_NumPad2;
+        case '3':
+            return enumKeyCodes::KEY_NumPad3;
+        case '4':
+            return enumKeyCodes::KEY_NumPad4;
+        case '5':
+            return enumKeyCodes::KEY_NumPad5;
+        case '6':
+            return enumKeyCodes::KEY_NumPad6;
+        case '7':
+            return enumKeyCodes::KEY_NumPad7;
+        case '8':
+            return enumKeyCodes::KEY_NumPad8;
+        case '9':
+            return enumKeyCodes::KEY_NumPad9;
+        case '.':
+            return enumKeyCodes::KEY_Decimal;
+        case '/':
+            return enumKeyCodes::KEY_Divide;
+        case '*':
+            return enumKeyCodes::KEY_Multiply;
+        case '-':
+            return enumKeyCodes::KEY_Subtract;
+        case '+':
+            return enumKeyCodes::KEY_Add;
+        case 3:
+            return enumKeyCodes::KEY_NumEnter;
+        case '=':
+            return enumKeyCodes::KEY_Equal;
+        default:
+            return enumKeyCodes::KEY_Unknown;
+    }
+}
+
+bool isKeyNumpad(NSEvent* event) {
+    return ([event modifierFlags] & NSEventModifierFlagNumericPad) != 0;
+}
+
+
+static void(*s_keyDownExecOrig)(void*, SEL, NSEvent*);
+void keyDownExecHook(void* self, SEL sel, NSEvent* event) {
+    bool extraKey = isExtraKey(event);
+    bool numpad = isKeyNumpad(event);
+    if (!extraKey && !numpad) {
+        return s_keyDownExecOrig(self, sel, event);
+    }
+    if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+        return s_keyDownExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+    if (extraKey) {
+        keyCode = extraKeyToKeyCode(event);
+    }
+    if (numpad) {
+        keyCode = numpadToKeyCode(event);
+    }
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, [event isARepeat]);
+}
+
+static void(*s_keyUpExecOrig)(void*, SEL, NSEvent*);
+void keyUpExecHook(void* self, SEL sel, NSEvent* event) {
+    bool extraKey = isExtraKey(event);
+    bool numpad = isKeyNumpad(event);
+    if (!extraKey && !numpad) {
+        return s_keyUpExecOrig(self, sel, event);
+    }
+    if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+        return s_keyUpExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+    if (extraKey) {
+        keyCode = extraKeyToKeyCode(event);
+    }
+    if (numpad) {
+        keyCode = numpadToKeyCode(event);
+    }
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, [event isARepeat]);
+}
+
+static void(*s_mouseDownExecOrig)(void*, SEL, NSEvent*);
+void mouseDownExecHook(void* self, SEL sel, NSEvent* event) {
+    if (!isExtraMouseButton(event)) {
+        return s_mouseDownExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = mouseButtonToKeyCode(event);
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, false);
+}
+
+static void(*s_mouseUpExecOrig)(void*, SEL, NSEvent*);
+void mouseUpExecHook(void* self, SEL sel, NSEvent* event) {
+    if (!isExtraMouseButton(event)) {
+        return s_mouseUpExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = mouseButtonToKeyCode(event);
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, false);
+}
+
+
+class $modify(CCKeyboardDispatcher) {
+    GEODE_FORWARD_COMPAT_DISABLE_HOOKS("CCKeyboardDispatcher new keys")
+
+    const char* keyToString(enumKeyCodes key) {
+        if (key < 0x1000) {
+            return CCKeyboardDispatcher::keyToString(key);
+        }
+
+        switch (key) {
+            case KEY_GraveAccent:
+                return "`";
+            case KEY_OEMEqual:
+                return "=";
+            case KEY_LeftBracket:
+                return "[";
+            case KEY_RightBracket:
+                return "]";
+            case KEY_Backslash:
+                return "\\";
+            case KEY_Semicolon:
+                return ";";
+            case KEY_Apostrophe:
+                return "'";
+            case KEY_Slash:
+                return "/";
+            case KEY_NumEnter:
+                return "NumEnter";
+            case KEY_World1:
+                return "INTL-1";
+            case KEY_World2:
+                return "INTL-2";
+            case MOUSE_4:
+                return "Mouse 4";
+            case MOUSE_5:
+                return "Mouse 5";
+            case MOUSE_6:
+                return "Mouse 6";
+            case MOUSE_7:
+                return "Mouse 7";
+            case MOUSE_8:
+                return "Mouse 8";
+            default:
+                return CCKeyboardDispatcher::keyToString(KEY_Unknown);
+        }
+    }
+};
+
+
+#define OBJC_SWIZZLE(klass, methodName) \
path: loader/src/hooks/AddExtraKeys.mm
user: login: qimiko
body: my new concern with swizzling (that i just made up) is that i think geode doing this would mess with other mods that also swizzle those methods - it might be good to make it a manual hook instead

ideally those mods would also switch to hooks but that requires i do something so... at least we can avoid making the problem worse lol
created_at: 2025-03-05T01:51:21Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,253 @@
+#import <Cocoa/Cocoa.h>
+#include <objc/runtime.h>
+#include <Carbon/Carbon.h>
+
+#include <Geode/DefaultInclude.hpp>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
+#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
+#include <Geode/cocos/text_input_node/CCIMEDispatcher.h>
+#include <Geode/modify/Modify.hpp>
+#include <Geode/modify/CCKeyboardDispatcher.hpp>
+
+using namespace geode::prelude;
+
+// https://github.com/SpaghettDev/BetterInputs/blob/44f249cd94f4cc19fca4de570dfab28f4efa3db8/src/platform/macos.mm#L121
+// we use this instead of [event keyCode] because the returned value of keyCode for letters is keyboard locale-specific
+int normalizedCodeFromEvent(NSEvent* event) {
+    if ([[event characters] length] > 0) {
+        return [[event characters] characterAtIndex:0];
+    } else if ([[event charactersIgnoringModifiers] length] > 0) {
+        return [[event charactersIgnoringModifiers] characterAtIndex:0];
+    }
+
+    return 0;
+}
+
+enumKeyCodes mouseButtonToKeyCode(NSEvent* event) {
+    switch ([event buttonNumber]) {
+        case 2:
+            return enumKeyCodes::MOUSE_4;
+        case 3:
+            return enumKeyCodes::MOUSE_5;
+        case 4:
+            return enumKeyCodes::MOUSE_6;
+        case 5:
+            return enumKeyCodes::MOUSE_7;
+        case 6:
+            return enumKeyCodes::MOUSE_8;
+        default:
+            return enumKeyCodes::KEY_Unknown;
+    }
+}
+
+bool isExtraMouseButton(NSEvent* event) {
+    return [event buttonNumber] > 1;
+}
+
+enumKeyCodes extraKeyToKeyCode(NSEvent* event) {
+    switch (normalizedCodeFromEvent(event)) {
+        case ';':
+            return enumKeyCodes::KEY_Semicolon;
+        case '\'':
+            return enumKeyCodes::KEY_Apostrophe;
+        case '/':
+            return enumKeyCodes::KEY_Slash;
+        case '=':
+            return enumKeyCodes::KEY_OEMEqual;
+        case '[':
+            return enumKeyCodes::KEY_LeftBracket;
+        case '\\':
+            return enumKeyCodes::KEY_Backslash;
+        case ']':
+            return enumKeyCodes::KEY_RightBracket;
+        case '`':
+            return enumKeyCodes::KEY_GraveAccent;
+        default:
+            break;
+    }
+
+    switch ([event keyCode]) {
+        case kVK_ISO_Section:
+            return enumKeyCodes::KEY_World2;
+        default:
+            break;
+    }
+
+    return enumKeyCodes::KEY_Unknown;
+}
+
+bool isExtraKey(NSEvent* event) {
+    return extraKeyToKeyCode(event) != enumKeyCodes::KEY_Unknown;
+}
+
+enumKeyCodes numpadToKeyCode(NSEvent* event) {
+    switch (normalizedCodeFromEvent(event)) {
+        case '0':
+            return enumKeyCodes::KEY_NumPad0;
+        case '1':
+            return enumKeyCodes::KEY_NumPad1;
+        case '2':
+            return enumKeyCodes::KEY_NumPad2;
+        case '3':
+            return enumKeyCodes::KEY_NumPad3;
+        case '4':
+            return enumKeyCodes::KEY_NumPad4;
+        case '5':
+            return enumKeyCodes::KEY_NumPad5;
+        case '6':
+            return enumKeyCodes::KEY_NumPad6;
+        case '7':
+            return enumKeyCodes::KEY_NumPad7;
+        case '8':
+            return enumKeyCodes::KEY_NumPad8;
+        case '9':
+            return enumKeyCodes::KEY_NumPad9;
+        case '.':
+            return enumKeyCodes::KEY_Decimal;
+        case '/':
+            return enumKeyCodes::KEY_Divide;
+        case '*':
+            return enumKeyCodes::KEY_Multiply;
+        case '-':
+            return enumKeyCodes::KEY_Subtract;
+        case '+':
+            return enumKeyCodes::KEY_Add;
+        case 3:
+            return enumKeyCodes::KEY_NumEnter;
+        case '=':
+            return enumKeyCodes::KEY_Equal;
+        default:
+            return enumKeyCodes::KEY_Unknown;
+    }
+}
+
+bool isKeyNumpad(NSEvent* event) {
+    return ([event modifierFlags] & NSEventModifierFlagNumericPad) != 0;
+}
+
+
+static void(*s_keyDownExecOrig)(void*, SEL, NSEvent*);
+void keyDownExecHook(void* self, SEL sel, NSEvent* event) {
+    bool extraKey = isExtraKey(event);
+    bool numpad = isKeyNumpad(event);
+    if (!extraKey && !numpad) {
+        return s_keyDownExecOrig(self, sel, event);
+    }
+    if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+        return s_keyDownExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+    if (extraKey) {
+        keyCode = extraKeyToKeyCode(event);
+    }
+    if (numpad) {
+        keyCode = numpadToKeyCode(event);
+    }
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, [event isARepeat]);
+}
+
+static void(*s_keyUpExecOrig)(void*, SEL, NSEvent*);
+void keyUpExecHook(void* self, SEL sel, NSEvent* event) {
+    bool extraKey = isExtraKey(event);
+    bool numpad = isKeyNumpad(event);
+    if (!extraKey && !numpad) {
+        return s_keyUpExecOrig(self, sel, event);
+    }
+    if (CCIMEDispatcher::sharedDispatcher()->hasDelegate()) {
+        return s_keyUpExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = enumKeyCodes::KEY_Unknown;
+    if (extraKey) {
+        keyCode = extraKeyToKeyCode(event);
+    }
+    if (numpad) {
+        keyCode = numpadToKeyCode(event);
+    }
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, [event isARepeat]);
+}
+
+static void(*s_mouseDownExecOrig)(void*, SEL, NSEvent*);
+void mouseDownExecHook(void* self, SEL sel, NSEvent* event) {
+    if (!isExtraMouseButton(event)) {
+        return s_mouseDownExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = mouseButtonToKeyCode(event);
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, true, false);
+}
+
+static void(*s_mouseUpExecOrig)(void*, SEL, NSEvent*);
+void mouseUpExecHook(void* self, SEL sel, NSEvent* event) {
+    if (!isExtraMouseButton(event)) {
+        return s_mouseUpExecOrig(self, sel, event);
+    }
+
+    enumKeyCodes keyCode = mouseButtonToKeyCode(event);
+    CCKeyboardDispatcher::get()->dispatchKeyboardMSG(keyCode, false, false);
+}
+
+
+class $modify(CCKeyboardDispatcher) {
+    GEODE_FORWARD_COMPAT_DISABLE_HOOKS("CCKeyboardDispatcher new keys")
+
+    const char* keyToString(enumKeyCodes key) {
+        if (key < 0x1000) {
+            return CCKeyboardDispatcher::keyToString(key);
+        }
+
+        switch (key) {
+            case KEY_GraveAccent:
+                return "`";
+            case KEY_OEMEqual:
+                return "=";
+            case KEY_LeftBracket:
+                return "[";
+            case KEY_RightBracket:
+                return "]";
+            case KEY_Backslash:
+                return "\\";
+            case KEY_Semicolon:
+                return ";";
+            case KEY_Apostrophe:
+                return "'";
+            case KEY_Slash:
+                return "/";
+            case KEY_NumEnter:
+                return "NumEnter";
+            case KEY_World1:
+                return "INTL-1";
+            case KEY_World2:
+                return "INTL-2";
+            case MOUSE_4:
+                return "Mouse 4";
+            case MOUSE_5:
+                return "Mouse 5";
+            case MOUSE_6:
+                return "Mouse 6";
+            case MOUSE_7:
+                return "Mouse 7";
+            case MOUSE_8:
+                return "Mouse 8";
+            default:
+                return CCKeyboardDispatcher::keyToString(KEY_Unknown);
+        }
+    }
+};
+
+
+#define OBJC_SWIZZLE(klass, methodName) \
path: loader/src/hooks/AddExtraKeys.mm
user: login: SpaghettDev
body: I hook these methods in BetterInputs and it mostly works fine, but sure, I could change to manual hooks instead of swizzling
created_at: 2025-03-05T03:23:06Z
author_association: CONTRIBUTOR

PR comments:
user: login: qimiko
created_at: 2025-03-05T01:44:24Z
body: you forgot the android inputs in [`loader/src/platform/android/input.cpp`](https://github.com/geode-sdk/geode/blob/main/loader/src/platform/android/input.cpp) :(

author_association: MEMBER
user: login: SpaghettDev
created_at: 2025-03-05T07:34:03Z
body: > you forgot the android inputs in [`loader/src/platform/android/input.cpp`](https://github.com/geode-sdk/geode/blob/main/loader/src/platform/android/input.cpp) :(

i blame flame imo
author_association: CONTRIBUTOR
user: login: SpaghettDev
created_at: 2025-03-07T03:12:06Z
body: > doesn't work on my iphone 17 air 😦

sorry, the iphone SE support is on its way..

i pone  support has been postponed again,... , the KeyboardDispatcher appears to have vanished in the ios :(

ifone suppotr was added after all.........
author_association: CONTRIBUTOR