mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Fixup for previous commit.
This commit is contained in:
parent
6efb223b49
commit
d21c75c40c
1 changed files with 24 additions and 1 deletions
|
@ -450,9 +450,32 @@ namespace entry
|
||||||
{
|
{
|
||||||
uint8_t modifiers = translateKeyModifiers(kev.keysym.mod);
|
uint8_t modifiers = translateKeyModifiers(kev.keysym.mod);
|
||||||
Key::Enum key = translateKey(kev.keysym.scancode);
|
Key::Enum key = translateKey(kev.keysym.scancode);
|
||||||
|
|
||||||
|
// TODO: These keys are not captured by SDL_TEXTINPUT. Should be probably handled by SDL_TEXTEDITING. This is a workaround for now.
|
||||||
|
if (key == 1) // Escape
|
||||||
|
{
|
||||||
|
uint8_t pressedChar[4];
|
||||||
|
pressedChar[0] = 0x1b;
|
||||||
|
m_eventQueue.postCharEvent(handle, 1, pressedChar);
|
||||||
|
}
|
||||||
|
else if (key == 2) // Enter
|
||||||
|
{
|
||||||
|
uint8_t pressedChar[4];
|
||||||
|
pressedChar[0] = 0x0d;
|
||||||
|
m_eventQueue.postCharEvent(handle, 1, pressedChar);
|
||||||
|
}
|
||||||
|
else if (key == 5) // Backspace
|
||||||
|
{
|
||||||
|
uint8_t pressedChar[4];
|
||||||
|
pressedChar[0] = 0x08;
|
||||||
|
m_eventQueue.postCharEvent(handle, 1, pressedChar);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_eventQueue.postKeyEvent(handle, key, modifiers, kev.state == SDL_PRESSED);
|
m_eventQueue.postKeyEvent(handle, key, modifiers, kev.state == SDL_PRESSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue