本文整理汇总了Python中Xlib.XK.__getattribute__方法的典型用法代码示例。如果您正苦于以下问题:Python XK.__getattribute__方法的具体用法?Python XK.__getattribute__怎么用?Python XK.__getattribute__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xlib.XK
的用法示例。
在下文中一共展示了XK.__getattribute__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import __getattribute__ [as 别名]
def __init__( self, _, action):
# (keycode,mapping) => [callback_id, calls]
# dictionaries, for handling repeats and cleanups of repeats
if not self.XKs:
for i in dir(XK):
if i.startswith("XK_") and not callable(i):
# pylint: disable-msg=E1101
self.XKs[i.lower()[3:]] = XK.__getattribute__(i)
# pylint: enable-msg=E1101
self.logger = logging.getLogger("LBRC.Listener.X11Event")
self.repeathandler = []
self.cleanup = []
self.commands = []
self.repeat_freq = 0
self.repeat_func = lambda x, n: x
self.repeat_commands = []
self.type = 'Generic Event'
self.uinput_dev = None
self.uinputbridge = None
if not 'map_to' in action:
self.logger.warning("Definition for XInput without mapping")
return
if action['type'] == 'mouseaxis':
self._init_mouseaxis(action)
elif action['type'] == 'mousebutton':
self._init_mousebutton(action)
elif action['type'] == 'key':
self._init_keypress(action)