本文整理汇总了Python中Xlib.XK.string_to_keysym方法的典型用法代码示例。如果您正苦于以下问题:Python XK.string_to_keysym方法的具体用法?Python XK.string_to_keysym怎么用?Python XK.string_to_keysym使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xlib.XK
的用法示例。
在下文中一共展示了XK.string_to_keysym方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: string_to_keycode
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import string_to_keysym [as 别名]
def string_to_keycode(self, key):
keysym = XK.string_to_keysym(key)
keycode = self.disp.keysym_to_keycode(keysym)
return keycode
示例2: mousemoveevent
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import string_to_keysym [as 别名]
def mousemoveevent(self, event):
self.mouse_position_x = event.root_x
self.mouse_position_y = event.root_y
# need the following because XK.keysym_to_string() only does printable chars
# rather than being the correct inverse of XK.string_to_keysym()
示例3: asciivalue
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import string_to_keysym [as 别名]
def asciivalue(self, keysym):
asciinum = XK.string_to_keysym(self.lookup_keysym(keysym))
if asciinum < 256:
return asciinum
else:
return 0
示例4: mousemoveevent
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import string_to_keysym [as 别名]
def mousemoveevent(self, event):
self.mouse_position_x = event.root_x
self.mouse_position_y = event.root_y
return self.makemousehookevent(event)
# need the following because XK.keysym_to_string() only does printable
# chars rather than being the correct inverse of XK.string_to_keysym()
示例5: asciivalue
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import string_to_keysym [as 别名]
def asciivalue(self, keysym):
asciinum = XK.string_to_keysym(self.lookup_keysym(keysym))
return asciinum % 256
示例6: mousemoveevent
# 需要导入模块: from Xlib import XK [as 别名]
# 或者: from Xlib.XK import string_to_keysym [as 别名]
def mousemoveevent(self, event):
self.mouse_position_x = event.root_x
self.mouse_position_y = event.root_y
return self.makemousehookevent(event)
# need the following because XK.keysym_to_string() only does printable chars
# rather than being the correct inverse of XK.string_to_keysym()