示例#1
0
 def __init__(self, parent=None, *a, **k):
  wx.StaticText.__init__(self, parent=parent)
  KeyboardHandler.__init__(self, *a, **k)
  self.wx_replacements = {}
  for i in [d for d in dir(wx) if d.startswith('WXK_')]:
   self.wx_replacements[getattr(wx, i)] = i[4:].lower()
  self.Bind(wx.EVT_KEY_DOWN, self.process_key, self)
  self.SetFocus()
示例#2
0
 def __init__(self, parent=None, *a, **k):
     wx.StaticText.__init__(self, parent=parent)
     KeyboardHandler.__init__(self, *a, **k)
     self.wx_replacements = {}
     for i in [d for d in dir(wx) if d.startswith('WXK_')]:
         self.wx_replacements[getattr(wx, i)] = i[4:].lower()
     self.Bind(wx.EVT_KEY_DOWN, self.process_key, self)
     self.SetFocus()
示例#3
0
    def register_key(self, key, function):
        """key will be a string, such as control+shift+f.
We need to convert that, using parse_key,
into modifier and key to put into our dictionary."""
        #register key so we know if we have it on event receive.
        t = parse(key)
        keys[t] = function
        #if we got this far, the key is valid.
        KeyboardHandler.register_key(self, key, function)
示例#4
0
文件: linux.py 项目: Oire/TWBlue
 def register_key(self, key, function):
  """key will be a string, such as control+shift+f.
We need to convert that, using parse_key,
into modifier and key to put into our dictionary."""
#register key so we know if we have it on event receive.
  t = parse(key)
  keys[t] = function
#if we got this far, the key is valid.
  KeyboardHandler.register_key(self, key, function)
示例#5
0
 def unregister_key(self, key, function):
     KeyboardHandler.unregister_key(self, key, function)
     del keys[parse(key)]
示例#6
0
 def __init__(self, *args, **kwargs):
     KeyboardHandler.__init__(self, *args, **kwargs)
     t = AtspiThread()
     t.start()
示例#7
0
文件: linux.py 项目: Oire/TWBlue
 def unregister_key (self, key, function):
  KeyboardHandler.unregister_key(self, key, function)
  del keys[parse(key)]
示例#8
0
文件: linux.py 项目: Oire/TWBlue
 def __init__(self, *args, **kwargs):
  KeyboardHandler.__init__(self, *args, **kwargs)
  t = AtspiThread()
  t.start()