mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Add SetKeysPressed() function to UiContext
This commit is contained in:
committed by
Gymnasiast
parent
898ffdb8e0
commit
999a467b9a
@@ -111,9 +111,8 @@ void TextComposition::HandleMessage(const SDL_Event * e)
|
||||
// Map Keypad enter to regular enter.
|
||||
key = SDLK_RETURN;
|
||||
}
|
||||
|
||||
// _lastKeyPressed = e.key.keysym.sym;
|
||||
// _keysPressed[e.key.keysym.scancode] = 1;
|
||||
|
||||
GetContext()->GetUiContext()->SetKeysPressed(key, e->key.keysym.scancode);
|
||||
|
||||
// Text input
|
||||
if (_session.Buffer == nullptr)
|
||||
|
||||
@@ -217,6 +217,12 @@ public:
|
||||
{
|
||||
SDL_SetWindowGrab(_window, value ? SDL_TRUE : SDL_FALSE);
|
||||
}
|
||||
|
||||
void SetKeysPressed(uint32 keysym, uint8 scancode) override
|
||||
{
|
||||
_lastKeyPressed = keysym;
|
||||
_keysPressed[scancode] = 1;
|
||||
}
|
||||
|
||||
// Drawing
|
||||
IDrawingEngine * CreateDrawingEngine(DRAWING_ENGINE_TYPE type) override
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace OpenRCT2
|
||||
virtual void SetCursorTrap(bool value) abstract;
|
||||
virtual const uint8 * GetKeysState() abstract;
|
||||
virtual const uint8 * GetKeysPressed() abstract;
|
||||
virtual void SetKeysPressed(uint32 keysym, uint8 scancode) abstract;
|
||||
|
||||
// Drawing
|
||||
virtual Drawing::IDrawingEngine * CreateDrawingEngine(Drawing::DRAWING_ENGINE_TYPE type) abstract;
|
||||
|
||||
Reference in New Issue
Block a user