mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-23 08:43:52 +00:00
feat: add support for keyboard and mouse input
This commit is contained in:
parent
9af787692e
commit
bdef1f9412
12 changed files with 640 additions and 27 deletions
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue