當前位置: 首頁>>代碼示例>>Python>>正文


Python pykeyboard.PyKeyboard方法代碼示例

本文整理匯總了Python中pykeyboard.PyKeyboard方法的典型用法代碼示例。如果您正苦於以下問題:Python pykeyboard.PyKeyboard方法的具體用法?Python pykeyboard.PyKeyboard怎麽用?Python pykeyboard.PyKeyboard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pykeyboard的用法示例。


在下文中一共展示了pykeyboard.PyKeyboard方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import pykeyboard [as 別名]
# 或者: from pykeyboard import PyKeyboard [as 別名]
def __init__(self, name):
        self.wname = name               #Name of the game window
        self.sv = ScreenViewer()        #For getting screens of the game
        self.mm = MovementMap()         #Bot's internal map of the world
        self.ts = TargetingSystem(m = 7, n = 9, ss = (800, 600), sb = (4, 0, 4, 12), cp = (400, 274), train = False)
        self.m = PyMouse()              #PyMouse object for triggering mouse input
        self.k = PyKeyboard()           #For triggering keyboard
        self.pm = ProjMap(800, 600)     #Convert between 3d and 2d coords
        self.p = None                   #The current path of the bot
        self.cpi = 0                    #Current potion index
        self.hp = None                  #Home position
        self.lwbp = False               #LW Button press occurred
        self.lwmoved = 0                #LW movement state
        self.state = Const.EVAD0        #State of bot
        self.tla = 0
        self.lwts = 0 
開發者ID:nicholastoddsmith,項目名稱:poeai,代碼行數:18,代碼來源:Bot.py

示例2: execute_all_generic_libraries_with_keyboard_only

# 需要導入模塊: import pykeyboard [as 別名]
# 或者: from pykeyboard import PyKeyboard [as 別名]
def execute_all_generic_libraries_with_keyboard_only(gui):
    menubar_ctrl = gui.singletons.main_window_controller.menu_bar_controller
    gui(
        menubar_ctrl.on_open_activate, None, None,
        testing_utils.get_test_sm_path(os.path.join("unit_test_state_machines", "all_generic_libraries"))
    )
    testing_utils.wait_for_gui()

    gui(menubar_ctrl.on_start_activate, None, None)
    import time
    from pykeyboard import PyKeyboard
    time.sleep(0.5)
    k = PyKeyboard()
    k.tap_key('Return', 7, 0.5)
    k.tap_key('Tab', 2, 0.5)
    k.tap_key('Return', 5, 0.5)
    gui(menubar_ctrl.on_stop_activate, None, None) 
開發者ID:DLR-RM,項目名稱:RAFCON,代碼行數:19,代碼來源:test_generic_libraries.py

示例3: _get_keyboard

# 需要導入模塊: import pykeyboard [as 別名]
# 或者: from pykeyboard import PyKeyboard [as 別名]
def _get_keyboard():
        # noinspection PyPackageRequirements
        from pykeyboard import PyKeyboard
        return PyKeyboard() 
開發者ID:BlackLight,項目名稱:platypush,代碼行數:6,代碼來源:inputs.py

示例4: __init__

# 需要導入模塊: import pykeyboard [as 別名]
# 或者: from pykeyboard import PyKeyboard [as 別名]
def __init__(self):
    """Creates an instance of `YoutubeControl`."""
    self._keyboard = PyKeyboard()
    self._command_lookup = {
        "left": self._keyboard.left_key,
        "right": self._keyboard.right_key,
        "up": self._keyboard.up_key,
        "down": self._keyboard.down_key,
        "shift": self._keyboard.shift_key
    } 
開發者ID:google-coral,項目名稱:project-keyword-spotter,代碼行數:12,代碼來源:run_yt_voice_control.py


注:本文中的pykeyboard.PyKeyboard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。