当前位置: 首页>>代码示例>>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;未经允许,请勿转载。