diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-04 03:56:03 -0600 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-04 03:56:03 -0600 |
| commit | 42aec6dac53dffa6afe072560a7e1d4986112538 (patch) | |
| tree | 0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.Client/Input.cpp | |
| parent | c9d58eeac7c72f0b3038e084667b4d89a6249fce (diff) | |
| parent | ef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff) | |
Merge branch 'main' into pr/win64-world-saves
# Conflicts:
# Minecraft.Client/MinecraftServer.cpp
# README.md
Diffstat (limited to 'Minecraft.Client/Input.cpp')
| -rw-r--r-- | Minecraft.Client/Input.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.Client/Input.cpp b/Minecraft.Client/Input.cpp index c1a3bb31..1639d09b 100644 --- a/Minecraft.Client/Input.cpp +++ b/Minecraft.Client/Input.cpp @@ -47,7 +47,7 @@ void Input::tick(LocalPlayer *player) #ifdef _WINDOWS64 // WASD movement (combine with gamepad) - if (iPad == 0) + if (iPad == 0 && KMInput.IsCaptured()) { float kbX = 0.0f, kbY = 0.0f; if (KMInput.IsKeyDown('W')) { kbY += 1.0f; sprintForward += 1.0f; usingKeyboardMovement = true; } @@ -83,8 +83,8 @@ void Input::tick(LocalPlayer *player) sprintForward = 0.0f; } - // 4J - in flying mode, don't actually toggle sneaking - if(!player->abilities.flying) + // 4J: In flying mode, don't actually toggle sneaking (unless we're riding in which case we need to sneak to dismount) + if(!player->abilities.flying || player->riding != NULL) { if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_SNEAK_TOGGLE)) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_SNEAK_TOGGLE)) { @@ -95,7 +95,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 && KMInput.IsCaptured() && KMInput.IsKeyDown(VK_SHIFT) && !player->abilities.flying) sneaking = true; #endif @@ -145,7 +145,7 @@ void Input::tick(LocalPlayer *player) // Delta should normally be 0 since applyFrameMouseLook() already consumed it if (rawDx != 0.0f || rawDy != 0.0f) { - float mouseSensitivity = 0.5f; + float mouseSensitivity = ((float)app.GetGameSettings(iPad, eGameSetting_Sensitivity_InGame)) / 100.0f; float mdx = rawDx * mouseSensitivity; float mdy = -rawDy * mouseSensitivity; if (app.GetGameSettings(iPad, eGameSetting_ControlInvertLook)) @@ -166,7 +166,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 && KMInput.IsCaptured() && KMInput.IsKeyDown(VK_SPACE) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_JUMP)) jumping = true; #endif |
