mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-04 18:29:41 +01:00
Fix issues with hotkey during text inputs.
This commit is contained in:
parent
76b326aac3
commit
2ddd7a96fb
2 changed files with 8 additions and 1 deletions
|
@ -79,6 +79,7 @@ void KeyPoll::disabletextentry()
|
||||||
|
|
||||||
void KeyPoll::Poll()
|
void KeyPoll::Poll()
|
||||||
{
|
{
|
||||||
|
bool modifierPressed = false;
|
||||||
SDL_Event evt;
|
SDL_Event evt;
|
||||||
while (SDL_PollEvent(&evt))
|
while (SDL_PollEvent(&evt))
|
||||||
{
|
{
|
||||||
|
@ -94,6 +95,8 @@ void KeyPoll::Poll()
|
||||||
pressedbackspace = true;
|
pressedbackspace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modifierPressed = keymap[SDLK_LCTRL] || keymap[SDLK_RCTRL] || keymap[SDLK_LALT] || keymap[SDLK_RALT] || keymap[SDLK_LGUI] || keymap[SDLK_RGUI];
|
||||||
|
|
||||||
#ifdef __APPLE__ /* OSX prefers the command keys over the alt keys. -flibit */
|
#ifdef __APPLE__ /* OSX prefers the command keys over the alt keys. -flibit */
|
||||||
bool altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI];
|
bool altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI];
|
||||||
#else
|
#else
|
||||||
|
@ -135,7 +138,10 @@ void KeyPoll::Poll()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
keybuffer += evt.text.text;
|
if (!modifierPressed)
|
||||||
|
{
|
||||||
|
keybuffer += evt.text.text;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Mouse Input */
|
/* Mouse Input */
|
||||||
|
|
|
@ -495,6 +495,7 @@ void editorclass::getlin(const enum textmode mode, const std::string& prompt, st
|
||||||
ed.textmod = mode;
|
ed.textmod = mode;
|
||||||
ed.textptr = ptr;
|
ed.textptr = ptr;
|
||||||
ed.textdesc = prompt;
|
ed.textdesc = prompt;
|
||||||
|
ed.textentry = true;
|
||||||
key.enabletextentry();
|
key.enabletextentry();
|
||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue