本文整理匯總了Python中gi.repository.Atspi.generate_keyboard_event方法的典型用法代碼示例。如果您正苦於以下問題:Python Atspi.generate_keyboard_event方法的具體用法?Python Atspi.generate_keyboard_event怎麽用?Python Atspi.generate_keyboard_event使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gi.repository.Atspi
的用法示例。
在下文中一共展示了Atspi.generate_keyboard_event方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generateKeyboardEvent
# 需要導入模塊: from gi.repository import Atspi [as 別名]
# 或者: from gi.repository.Atspi import generate_keyboard_event [as 別名]
def generateKeyboardEvent(self, keycode, keysym, kind):
"""
Generates a keyboard event. One of the keycode or the keysym parameters
should be specified and the other should be None. The kind parameter is
required and should be one of the KEY_PRESS, KEY_RELEASE, KEY_PRESSRELEASE,
KEY_SYM, or KEY_STRING.
@@param keycode: Hardware keycode or None
@@type keycode: integer
@@param keysym: Symbolic key string or None
@@type keysym: string
@@param kind: Kind of event to synthesize
@@type kind: integer
"""
if not self.has_implementations:
self._set_default_registry ()
if keysym is None:
keysym = ""
Atspi.generate_keyboard_event (keycode, keysym, kind)
示例2: release_keycode
# 需要導入模塊: from gi.repository import Atspi [as 別名]
# 或者: from gi.repository.Atspi import generate_keyboard_event [as 別名]
def release_keycode(self, keycode):
#print("release_keycode")
Atspi.generate_keyboard_event(keycode, "", Atspi.KeySynthType.RELEASE)
示例3: press_key_string
# 需要導入模塊: from gi.repository import Atspi [as 別名]
# 或者: from gi.repository.Atspi import generate_keyboard_event [as 別名]
def press_key_string(self, string):
#print("press_key_string")
Atspi.generate_keyboard_event(0, string, Atspi.KeySynthType.STRING)
示例4: key_press
# 需要導入模塊: from gi.repository import Atspi [as 別名]
# 或者: from gi.repository.Atspi import generate_keyboard_event [as 別名]
def key_press(key_name):
key_sym = name_to_sym(key_name)
Atspi.generate_keyboard_event(key_sym,
None,
Atspi.KeySynthType.SYM)
示例5: press_keycode
# 需要導入模塊: from gi.repository import Atspi [as 別名]
# 或者: from gi.repository.Atspi import generate_keyboard_event [as 別名]
def press_keycode(self, keycode):
#print("press_keycode")
Atspi.generate_keyboard_event(keycode, "", Atspi.KeySynthType.PRESS)