This commit is contained in:
2026-08-26 18:53:31 -05:00
parent 1bb3be26ec
commit d3bfe54f73
3 changed files with 19 additions and 19 deletions
+9 -9
View File
@@ -47,10 +47,10 @@ void Input::tick(LocalPlayer *player)
if (iPad == 0)
{
float kbX = 0.0f, kbY = 0.0f;
if (KMInput.IsKeyDown('W')) kbY += 1.0f;
if (KMInput.IsKeyDown('S')) kbY -= 1.0f;
if (KMInput.IsKeyDown('A')) kbX += 1.0f; // inverted like gamepad
if (KMInput.IsKeyDown('D')) kbX -= 1.0f;
if (g_KBMInput.IsKeyDown('W')) kbY += 1.0f;
if (g_KBMInput.IsKeyDown('S')) kbY -= 1.0f;
if (g_KBMInput.IsKeyDown('A')) kbX += 1.0f; // inverted like gamepad
if (g_KBMInput.IsKeyDown('D')) kbX -= 1.0f;
// Normalize diagonal
if (kbX != 0.0f && kbY != 0.0f) { kbX *= 0.707f; kbY *= 0.707f; }
if (pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_LEFT) || pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_RIGHT))
@@ -88,7 +88,7 @@ void Input::tick(LocalPlayer *player)
#ifdef _WINDOWS64
// Keyboard hold-to-sneak (overrides gamepad toggle)
if (iPad == 0 && KMInput.IsKeyDown(VK_SHIFT) && !player->abilities.flying)
if (iPad == 0 && g_KBMInput.IsKeyDown(VK_SHIFT) && !player->abilities.flying)
sneaking = true;
#endif
@@ -129,11 +129,11 @@ void Input::tick(LocalPlayer *player)
#ifdef _WINDOWS64
// Mouse look (added after stick-based turn)
if (iPad == 0 && KMInput.IsCaptured())
if (iPad == 0 && g_KBMInput.IsCaptured())
{
float mouseSensitivity = 1.25f;
float mdx = KMInput.GetMouseDeltaX() * mouseSensitivity;
float mdy = -KMInput.GetMouseDeltaY() * mouseSensitivity;
float mdx = g_KBMInput.GetMouseDeltaX() * mouseSensitivity;
float mdy = -g_KBMInput.GetMouseDeltaY() * mouseSensitivity;
if (app.GetGameSettings(iPad, eGameSetting_ControlInvertLook))
mdy = -mdy;
player->interpolateTurn(mdx, mdy);
@@ -151,7 +151,7 @@ void Input::tick(LocalPlayer *player)
#ifdef _WINDOWS64
// Keyboard jump (Space)
if (iPad == 0 && KMInput.IsKeyDown(VK_SPACE) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_JUMP))
if (iPad == 0 && g_KBMInput.IsKeyDown(VK_SPACE) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_JUMP))
jumping = true;
#endif