From: Josh Blum Date: Fri, 11 Sep 2009 00:38:53 +0000 (-0700) Subject: rename variable, use keysyms in props dialog X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=14ae3c5141e3d39b89a4aac19681ec8ac7cd05ee;p=debian%2Fgnuradio rename variable, use keysyms in props dialog --- diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py index d3d63f29..cacee22c 100644 --- a/grc/gui/Actions.py +++ b/grc/gui/Actions.py @@ -98,7 +98,7 @@ _actions_key_list = ( ) _actions_key_dict = dict(((key_val, mod_mask), action_name) for action_name, key_val, mod_mask in _actions_key_list) -_all_mods_mask = reduce(lambda x, y: x | y, [mod_mask for action_name, key_val, mod_mask in _actions_key_list], NO_MODS_MASK) +_used_mods_mask = reduce(lambda x, y: x | y, [mod_mask for action_name, key_val, mod_mask in _actions_key_list], NO_MODS_MASK) def get_action_name_from_key_press(key_val, mod_mask=NO_MODS_MASK): """ Get the action name associated with the key value and mask. @@ -107,7 +107,7 @@ def get_action_name_from_key_press(key_val, mod_mask=NO_MODS_MASK): @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 + mod_mask &= _used_mods_mask #ignore irrelevant modifiers key_val_mod_mask = (key_val, mod_mask) try: return _actions_key_dict[key_val_mod_mask] except KeyError: return '' diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py index 29b3c7b4..b295ba41 100644 --- a/grc/gui/PropsDialog.py +++ b/grc/gui/PropsDialog.py @@ -154,8 +154,9 @@ class PropsDialog(gtk.Dialog): Call the ok response when enter is pressed. @return false to forward the keypress """ - keyname = gtk.gdk.keyval_name(event.keyval) - if keyname == 'Return': self.response(gtk.RESPONSE_ACCEPT) + if event.keyval == gtk.keysyms.Return: + self.response(gtk.RESPONSE_ACCEPT) + return True #handled here return False #forward the keypress def run(self):