From ab323a75501338a97145b5f49ec6b42745b870b9 Mon Sep 17 00:00:00 2001 From: Nichole Mattera Date: Wed, 12 Aug 2020 21:08:25 -0400 Subject: [PATCH] Simplified the fixes. --- desktop_version/src/KeyPoll.cpp | 10 ++++------ desktop_version/src/editor.cpp | 1 - desktop_version/src/main.cpp | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/desktop_version/src/KeyPoll.cpp b/desktop_version/src/KeyPoll.cpp index e6242369..88c7a5bf 100644 --- a/desktop_version/src/KeyPoll.cpp +++ b/desktop_version/src/KeyPoll.cpp @@ -79,7 +79,7 @@ void KeyPoll::disabletextentry() void KeyPoll::Poll() { - bool modifierPressed = false; + bool altpressed = false; SDL_Event evt; while (SDL_PollEvent(&evt)) { @@ -95,12 +95,10 @@ 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]; + altpressed = keymap[SDLK_LGUI] || keymap[SDLK_RGUI]; #else - bool altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT]; + altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT]; #endif bool returnpressed = evt.key.keysym.sym == SDLK_RETURN; bool fpressed = evt.key.keysym.sym == SDLK_f; @@ -138,7 +136,7 @@ void KeyPoll::Poll() } break; case SDL_TEXTINPUT: - if (!modifierPressed) + if (!altpressed) { keybuffer += evt.text.text; } diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 6ee8c7f8..2eaaa905 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -495,7 +495,6 @@ 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) { diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index e0f677b3..dfab5fee 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -617,7 +617,7 @@ void inline fixedloop() //Mute button #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 bool inEditor = false; #endif