From db98f6245e3da6a7882cb62e16ac623db73bf5c2 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 14 Apr 2014 17:03:05 -0400 Subject: [PATCH] Fixed first button in dialog without attached key being triggered by any unknown key --- osx/boe.actions.cpp | 1 + osx/dialogxml/control.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osx/boe.actions.cpp b/osx/boe.actions.cpp index 403db1a5..299914ca 100644 --- a/osx/boe.actions.cpp +++ b/osx/boe.actions.cpp @@ -1584,6 +1584,7 @@ char keyToChar(sf::Keyboard::Key key, bool isShift) { case kb::BackSpace: return '\b'; case kb::Delete: return '\x7f'; } + return 0; } bool handle_keystroke(sf::Event& event){ diff --git a/osx/dialogxml/control.cpp b/osx/dialogxml/control.cpp index 1b1e2a14..c893238e 100644 --- a/osx/dialogxml/control.cpp +++ b/osx/dialogxml/control.cpp @@ -145,7 +145,7 @@ eKeyMod& operator -= (eKeyMod&lhs, eKeyMod rhs){ bool operator== (cKey a, cKey b){ if(a.spec != b.spec) return false; if(a.mod != b.mod) return false; - return a.spec ? a.k == b.k : a.c == b.c; + return a.spec ? a.k == b.k : (a.c == 0 ? false : a.c == b.c); } bool mod_contains(eKeyMod mods, eKeyMod mod) {