1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Simplified the fixes.

This commit is contained in:
Nichole Mattera 2020-08-12 21:08:25 -04:00 committed by Ethan Lee
parent 51119d4394
commit ab323a7550
3 changed files with 5 additions and 8 deletions

View file

@ -79,7 +79,7 @@ void KeyPoll::disabletextentry()
void KeyPoll::Poll() void KeyPoll::Poll()
{ {
bool modifierPressed = false; bool altpressed = false;
SDL_Event evt; SDL_Event evt;
while (SDL_PollEvent(&evt)) while (SDL_PollEvent(&evt))
{ {
@ -95,12 +95,10 @@ 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]; altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI];
#else #else
bool altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT]; altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT];
#endif #endif
bool returnpressed = evt.key.keysym.sym == SDLK_RETURN; bool returnpressed = evt.key.keysym.sym == SDLK_RETURN;
bool fpressed = evt.key.keysym.sym == SDLK_f; bool fpressed = evt.key.keysym.sym == SDLK_f;
@ -138,7 +136,7 @@ void KeyPoll::Poll()
} }
break; break;
case SDL_TEXTINPUT: case SDL_TEXTINPUT:
if (!modifierPressed) if (!altpressed)
{ {
keybuffer += evt.text.text; keybuffer += evt.text.text;
} }

View file

@ -495,7 +495,6 @@ 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)
{ {

View file

@ -617,7 +617,7 @@ void inline fixedloop()
//Mute button //Mute button
#if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR) #if !defined(NO_CUSTOM_LEVELS) && !defined(NO_EDITOR)
bool inEditor = ed.textentry || ed.scripthelppage == 1; bool inEditor = ed.textentry || ed.textmod != TEXT_NONE || ed.scripthelppage == 1;
#else #else
bool inEditor = false; bool inEditor = false;
#endif #endif