mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
sprint on ctrl
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "Minecraft.h"
|
#include "Minecraft.h"
|
||||||
#include "client/player/input/IBuildInput.h"
|
#include "client/player/input/IBuildInput.h"
|
||||||
|
#include "platform/input/Keyboard.h"
|
||||||
#include "world/item/Item.h"
|
#include "world/item/Item.h"
|
||||||
#include "world/item/ItemInstance.h"
|
#include "world/item/ItemInstance.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -727,6 +728,10 @@ void Minecraft::tickInput() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
|
if (key == Keyboard::KEY_LEFT_CTRL) {
|
||||||
|
player->setSprinting(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (key == Keyboard::KEY_E) {
|
if (key == Keyboard::KEY_E) {
|
||||||
screenChooser.setScreen(SCREEN_BLOCKSELECTION);
|
screenChooser.setScreen(SCREEN_BLOCKSELECTION);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ private:
|
|||||||
bool sprinting;
|
bool sprinting;
|
||||||
int sprintDoubleTapTimer;
|
int sprintDoubleTapTimer;
|
||||||
bool prevForwardHeld;
|
bool prevForwardHeld;
|
||||||
|
public:
|
||||||
|
void setSprinting(bool sprint) { sprinting = sprint; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*NET_MINECRAFT_CLIENT_PLAYER__LocalPlayer_H__*/
|
#endif /*NET_MINECRAFT_CLIENT_PLAYER__LocalPlayer_H__*/
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ int transformKey(int glfwkey) {
|
|||||||
case GLFW_KEY_BACKSPACE: return Keyboard::KEY_BACKSPACE;
|
case GLFW_KEY_BACKSPACE: return Keyboard::KEY_BACKSPACE;
|
||||||
case GLFW_KEY_LEFT_SHIFT: return Keyboard::KEY_LSHIFT;
|
case GLFW_KEY_LEFT_SHIFT: return Keyboard::KEY_LSHIFT;
|
||||||
case GLFW_KEY_ENTER: return Keyboard::KEY_RETURN;
|
case GLFW_KEY_ENTER: return Keyboard::KEY_RETURN;
|
||||||
|
case GLFW_KEY_LEFT_CONTROL: return Keyboard::KEY_LEFT_CTRL;
|
||||||
default: return glfwkey;
|
default: return glfwkey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,9 +71,11 @@ public:
|
|||||||
static const int KEY_F11 = 122;
|
static const int KEY_F11 = 122;
|
||||||
static const int KEY_F12 = 123;
|
static const int KEY_F12 = 123;
|
||||||
|
|
||||||
|
|
||||||
static const int KEY_ESCAPE = 27;
|
static const int KEY_ESCAPE = 27;
|
||||||
static const int KEY_SPACE = 32;
|
static const int KEY_SPACE = 32;
|
||||||
static const int KEY_LSHIFT = 10;
|
static const int KEY_LSHIFT = 10;
|
||||||
|
static const int KEY_LEFT_CTRL = 232;
|
||||||
|
|
||||||
static bool isKeyDown(int keyCode) {
|
static bool isKeyDown(int keyCode) {
|
||||||
return _states[keyCode] == KeyboardAction::KEYDOWN;
|
return _states[keyCode] == KeyboardAction::KEYDOWN;
|
||||||
|
|||||||
Reference in New Issue
Block a user