- First commit to gitea
This commit is contained in:
27
GUIKeyboard.cpp
Normal file
27
GUIKeyboard.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "GUIKeyboard.h"
|
||||
|
||||
#include "application.h"
|
||||
|
||||
namespace GUIKeyboard
|
||||
{
|
||||
SDL_Keycode key {SDLK_UNKNOWN};
|
||||
bool shift {false};
|
||||
bool alt {false};
|
||||
bool cmd {false};
|
||||
|
||||
void ReceiveKeyboardEvent(const SDL_Keycode key)
|
||||
{
|
||||
GUIKeyboard::key = key;
|
||||
SDL_Keymod mod = SDL_GetModState();
|
||||
shift = ((mod & KMOD_SHIFT) != KMOD_NONE);
|
||||
alt = ((mod & KMOD_ALT ) != KMOD_NONE);
|
||||
cmd = ((mod & KMOD_GUI ) != KMOD_NONE);
|
||||
Application::NeedsUpdate();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
key = SDLK_UNKNOWN;
|
||||
//shift = alt = cmd = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user