From 1dc8a005ed111463c22c17b487e5ec8a3e2d30f3 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Wed, 4 Mar 2026 21:19:40 +0800 Subject: refactor: refactor KBM input code --- Minecraft.Client/stubs.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'Minecraft.Client/stubs.h') diff --git a/Minecraft.Client/stubs.h b/Minecraft.Client/stubs.h index cc788867..f4ae056f 100644 --- a/Minecraft.Client/stubs.h +++ b/Minecraft.Client/stubs.h @@ -187,12 +187,13 @@ public: static void create() {} static void destroy() {} #ifdef _WINDOWS64 - static bool isKeyDown(int key); + static bool isKeyDown(int keyCode); #else - static bool isKeyDown(int) {return false;} + static bool isKeyDown(int) { return false; } #endif static wstring getKeyName(int) { return L"KEYNAME"; } static void enableRepeatEvents(bool) {} + static const int KEY_A = 0; static const int KEY_B = 1; static const int KEY_C = 2; @@ -228,8 +229,32 @@ public: static const int KEY_UP = 32; static const int KEY_DOWN = 33; static const int KEY_TAB = 34; - static const int KEY_LEFT = 35; - static const int KEY_RIGHT = 36; + static const int KEY_1 = 35; + static const int KEY_2 = 36; + static const int KEY_3 = 37; + static const int KEY_4 = 38; + static const int KEY_5 = 39; + static const int KEY_6 = 40; + static const int KEY_7 = 41; + static const int KEY_8 = 42; + static const int KEY_9 = 43; + static const int KEY_F1 = 44; + static const int KEY_F3 = 45; + static const int KEY_F4 = 46; + static const int KEY_F5 = 47; + static const int KEY_F6 = 48; + static const int KEY_F8 = 49; + static const int KEY_F9 = 50; + static const int KEY_F11 = 51; + static const int KEY_ADD = 52; + static const int KEY_SUBTRACT = 53; + static const int KEY_LEFT = 54; + static const int KEY_RIGHT = 55; + +#ifdef _WINDOWS64 + // Map LWJGL-style key constant to Windows VK code + static int toVK(int keyConst); +#endif }; class Mouse -- cgit v1.2.3