diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 18:50:55 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 19:20:41 +0800 |
| commit | bdef1f9412d21757bc4a21ed905daff32fd0df27 (patch) | |
| tree | 26f8aad48a60a67b8e3c61ac94005456427716a4 /Minecraft.Client/LocalPlayer.cpp | |
| parent | 9af787692e3925d70c9f29eca3c47bdb7479d076 (diff) | |
feat: add support for keyboard and mouse input
Diffstat (limited to 'Minecraft.Client/LocalPlayer.cpp')
| -rw-r--r-- | Minecraft.Client/LocalPlayer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index ea66b9e1..aabd6a2b 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -302,6 +302,15 @@ void LocalPlayer::aiStep() // world with low food, then reload it in creative. if(abilities.mayfly || isAllowedToFly() ) enoughFoodToSprint = true; +#ifdef _WINDOWS64 + // Keyboard sprint: Ctrl held while moving forward + if (GetXboxPad() == 0 && KMInput.IsKeyDown(VK_CONTROL) && input->ya > 0.0f && + enoughFoodToSprint && !isUsingItem() && !hasEffect(MobEffect::blindness) && onGround) + { + if (!isSprinting()) setSprinting(true); + } +#endif + // 4J - altered this slightly to make sure that the joypad returns to below returnTreshold in between registering two movements up to runThreshold if (onGround && !isSprinting() && enoughFoodToSprint && !isUsingItem() && !hasEffect(MobEffect::blindness)) { |
