From 131d04cf423b36bcfeba351eecc520b94586f729 Mon Sep 17 00:00:00 2001 From: simonb Date: Sun, 25 Jun 2006 14:00:13 +0000 Subject: Check for NoSymbol more explicitly - thanks Julien Trolet (dmxen at sourceforge) --- ChangeLog | 3 +++ src/FbTk/KeyUtil.cc | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fa3821..15001b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 1.0rc2: *06/06/25: + * Explicitly map NoSymbol to keycode 0 (thanks Julien Trolet) + (seems to be assigned to several keycodes) + FbTk/KeyUtil.cc * Menu aware of text encodings (Simon) - new menu file options: [encoding] {CODESET} diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc index cb0db93..4300cd7 100644 --- a/src/FbTk/KeyUtil.cc +++ b/src/FbTk/KeyUtil.cc @@ -172,8 +172,10 @@ void KeyUtil::grabKey(unsigned int key, unsigned int mod) { unsigned int KeyUtil::getKey(const char *keystr) { if (!keystr) return 0; - return XKeysymToKeycode(App::instance()->display(), - XStringToKeysym(keystr)); + KeySym sym = XStringToKeysym(keystr); + if (sym==NoSymbol) + return 0; + return XKeysymToKeycode(App::instance()->display(), sym); } -- cgit v0.11.2