diff options
author | Josh Blum | 2009-09-10 14:47:53 -0700 |
---|---|---|
committer | Josh Blum | 2009-09-10 14:47:53 -0700 |
commit | 417bb0aacf320043994ac1a0a5f49b977d1a9d22 (patch) | |
tree | 1914e7478071332d012a8a147b8717721f3e952d /grc | |
parent | bced51e1fe3694e073bebf053b2c69bc5128e00b (diff) | |
download | gnuradio-417bb0aacf320043994ac1a0a5f49b977d1a9d22.tar.gz gnuradio-417bb0aacf320043994ac1a0a5f49b977d1a9d22.tar.bz2 gnuradio-417bb0aacf320043994ac1a0a5f49b977d1a9d22.zip |
ignore irrelevant modifiers and events pending
Diffstat (limited to 'grc')
-rw-r--r-- | grc/gui/ActionHandler.py | 2 | ||||
-rw-r--r-- | grc/gui/Actions.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 656f99c37..970b731c8 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -79,8 +79,6 @@ class ActionHandler: When not in focus, gtk and the accelerators handle the the key press. @return false to let gtk handle the key action """ - #dont allow key presses to queue up - if gtk.events_pending(): return True #extract action name from this key press key_name = gtk.gdk.keyval_name(event.keyval) mod_mask = event.state diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py index c3ef2711a..1d6a2afba 100644 --- a/grc/gui/Actions.py +++ b/grc/gui/Actions.py @@ -97,6 +97,7 @@ _actions_key_list = ( ) _actions_key_dict = dict(((key_name, mod_mask), action_name) for action_name, key_name, mod_mask in _actions_key_list) +_all_mods_mask = reduce(lambda x, y: x | y, [mod_mask for action_name, key_name, mod_mask in _actions_key_list], 0) def get_action_name_from_key_name(key_name, mod_mask=0): """ Get the action name associated with the key name and mask. @@ -105,6 +106,7 @@ def get_action_name_from_key_name(key_name, mod_mask=0): @param mod_mask the key press mask (shift, ctrl) 0 for none @return the action name or blank string """ + mod_mask &= _all_mods_mask #ignore irrelevant modifiers key_name_mod_mask = (key_name, mod_mask) if key_name_mod_mask in _actions_key_dict: return _actions_key_dict[key_name_mod_mask] return '' |