wxgoodies/keys.py
def key_to_str(modifiers, key, mods_table = mods, key_table = wx, key_prefix = 'WXK_'):
 """
 Returns a human-readable version of numerical modifiers and key.
 
 To make the key suitable for global hotkey usage, supply:
 mods_table = global_mods, key_table = win32con, key_prefix = 'VK_'
 """
 logger.debug('Converting (%s, %s) to string.', modifiers, key)
 if not key:
  key_str = 'NONE'
 else:
  key_str = None
 res = ''
 for value, name in mods_table.items():
  if (modifiers & value):
   res += name + '+'
 for x in dir(key_table):
  if x.startswith(key_prefix):
   if getattr(key_table, x) == key:
    key_str = converts.get(x, x[len(key_prefix):])
 if not key_str:
  key_str = chr(key)
 res += key_str
 logger.debug('Final result: %s.', res)
 return res
def key_to_str(modifiers, key, mods_table = mods, key_table = wx, key_prefix = 'WXK_'):
 """
 Returns a human-readable version of numerical modifiers and key.
 
 To make the key suitable for global hotkey usage, supply:
 mods_table = global_mods, key_table = win32con, key_prefix = 'VK_'
 """
 logger.debug('Converting (%s, %s) to string.', modifiers, key)
 if not key:
  key_str = 'NONE'
 else:
  key_str = None
 res = ''
 for value, name in mods_table.items():
  if (modifiers & value):
   res += name + '+'
 for x in dir(key_table):
  if x.startswith(key_prefix):
   if getattr(key_table, x) == key:
    key_str = converts.get(x, x[len(key_prefix):])
 if not key_str:
  key_str = chr(key)
 res += key_str
 logger.debug('Final result: %s.', res)
 return res
def key_to_str ( modifiers , key , mods_table = mods , key_table = wx , key_prefix = 'WXK_' ) : logger . debug ( 'Converting (%s, %s) to string.' , modifiers , key ) if not key : key_str = 'NONE' else : key_str = None res = '' for value , name in mods_table . items ( ) : if ( modifiers & value ) : res += name + '+' for x in dir ( key_table ) : if x . startswith ( key_prefix ) : if getattr ( key_table , x ) == key : key_str = converts . get ( x , x [ len ( key_prefix ) : ] ) if not key_str : key_str = chr ( key ) res += key_str logger . debug ( 'Final result: %s.' , res ) return res
Returns a human-readable version of numerical modifiers and key.
 
 To make the key suitable for global hotkey usage, supply:
 mods_table = global_mods, key_table = win32con, key_prefix = 'VK_'
Returns a human - readable version of numerical modifiers and key . To make the key suitable for global hotkey usage supply : mods_table = global_mods key_table = win32con key_prefix = VK_