1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00

Fix issues with hotkey during text inputs.

This commit is contained in:
Nichole Mattera 2020-08-12 19:07:36 -04:00 committed by Ethan Lee
parent 76b326aac3
commit 2ddd7a96fb
2 changed files with 8 additions and 1 deletions

View File

@ -79,6 +79,7 @@ void KeyPoll::disabletextentry()
void KeyPoll::Poll()
{
bool modifierPressed = false;
SDL_Event evt;
while (SDL_PollEvent(&evt))
{
@ -94,6 +95,8 @@ void KeyPoll::Poll()
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 */
bool altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI];
#else
@ -135,7 +138,10 @@ void KeyPoll::Poll()
}
break;
case SDL_TEXTINPUT:
keybuffer += evt.text.text;
if (!modifierPressed)
{
keybuffer += evt.text.text;
}
break;
/* Mouse Input */

View File

@ -495,6 +495,7 @@ void editorclass::getlin(const enum textmode mode, const std::string& prompt, st
ed.textmod = mode;
ed.textptr = ptr;
ed.textdesc = prompt;
ed.textentry = true;
key.enabletextentry();
if (ptr)
{