1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Initialise UiContext input fields

This was causing undefined data to appear in _keysPressed which caused shortcuts to be invoked on startup.
This commit is contained in:
Ted John
2017-05-27 19:59:59 +01:00
committed by Gymnasiast
parent 1eb5ed0c93
commit e313568a27

View File

@@ -75,12 +75,12 @@ private:
// Input
TextComposition _textComposition;
CursorState _cursorState;
uint32 _lastKeyPressed;
const uint8 * _keysState;
uint8 _keysPressed[256];
uint32 _lastGestureTimestamp;
float _gestureRadius;
CursorState _cursorState = { 0 };
uint32 _lastKeyPressed = 0;
const uint8 * _keysState = nullptr;
uint8 _keysPressed[256] = { 0 };
uint32 _lastGestureTimestamp = 0;
float _gestureRadius = 0;
public:
UiContext()
@@ -217,7 +217,7 @@ public:
{
SDL_SetWindowGrab(_window, value ? SDL_TRUE : SDL_FALSE);
}
void SetKeysPressed(uint32 keysym, uint8 scancode) override
{
_lastKeyPressed = keysym;