Skip to content

Commit

Permalink
Use UTF8 length to decide if a TEXTINPUT is a hotkey (should fix #1855)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel authored and jyrkive committed Aug 2, 2017
1 parent 62ec3b3 commit 047120e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hotkey/command_executor.cpp
Expand Up @@ -29,6 +29,7 @@
#include "display.hpp"
#include "quit_confirmation.hpp"
#include "show_dialog.hpp"
#include "unicode.hpp"

#include "utils/functional.hpp"

Expand Down Expand Up @@ -520,10 +521,7 @@ static void event_execute( const SDL_Event& event, command_executor* executor)
if(!CKey::is_uncomposable(event.key) && !(mods & KMOD_CTRL) && !(mods & KMOD_ALT) && !(mods & KMOD_GUI)) {
return;
}
} else if(event.type == SDL_TEXTINPUT && (
static_cast<signed char>(event.text.text[0]) <= '\0' ||
(event.text.text[1] != '\0')))
{
} else if(event.type == SDL_TEXTINPUT && event.text.text[31] == 0 && utf8::size(utf8::string(event.text.text)) == 1) {
return;
}

Expand Down

0 comments on commit 047120e

Please sign in to comment.