geode icon indicating copy to clipboard operation
geode copied to clipboard

Add handling of unused keys and mouse buttons, rewrite numpad input

Open Fleeym opened this issue 1 year ago • 0 comments

This PR implements unused keys and mouse buttons. It does not include mouse left click, right click, scroll click. Additionally, it remaps numpad input from their KEY_1 - KEY_0 counterparts to their actual numpad enumKeyCodes.

Added key codes are as follows

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

CCKeyboardDispatcher::dispatchKeyboardMSG will use these codes instead of -1. Additionally, I have hooked CCKeyboardDispatcher::keyToString for the newly created key codes.

This will remain a draft PR until I figure out how MacOS does keyboard and mouse input.

Fleeym avatar Apr 20 '24 16:04 Fleeym