当前位置: 首页>>代码示例>>Python>>正文


Python keyboard.Controller方法代码示例

本文整理汇总了Python中pynput.keyboard.Controller方法的典型用法代码示例。如果您正苦于以下问题:Python keyboard.Controller方法的具体用法?Python keyboard.Controller怎么用?Python keyboard.Controller使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pynput.keyboard的用法示例。


在下文中一共展示了keyboard.Controller方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: enter_input

# 需要导入模块: from pynput import keyboard [as 别名]
# 或者: from pynput.keyboard import Controller [as 别名]
def enter_input():
    if PYINPUT:
        keyboard = Controller()
        keyboard.press(Key.enter)
        keyboard.release(Key.enter) 
开发者ID:ElevenPaths,项目名称:ibombshell,代码行数:7,代码来源:listener.py

示例2: load_instructions

# 需要导入模块: from pynput import keyboard [as 别名]
# 或者: from pynput.keyboard import Controller [as 别名]
def load_instructions(f):
    keyboard = Controller()
    sleep(1)
    data_file = open(f)
    for line in data_file.readlines():
        keyboard.type(line + "\n")
        sleep(0.2) 
开发者ID:ElevenPaths,项目名称:ibombshell,代码行数:9,代码来源:ibombshell.py

示例3: click

# 需要导入模块: from pynput import keyboard [as 别名]
# 或者: from pynput.keyboard import Controller [as 别名]
def click(x, y):
    mouse.press(Button.left)
    return

# Keyboard: 
开发者ID:ardamavi,项目名称:Game-Bot,代码行数:7,代码来源:game_control.py

示例4: _key_change_callback

# 需要导入模块: from pynput import keyboard [as 别名]
# 或者: from pynput.keyboard import Controller [as 别名]
def _key_change_callback(deck_id: str, _deck: StreamDeck.StreamDeck, key: int, state: bool) -> None:
    if state:
        keyboard = Controller()
        page = get_page(deck_id)

        command = get_button_command(deck_id, page, key)
        if command:
            Popen(command.split(" "))

        keys = get_button_keys(deck_id, page, key)
        if keys:
            keys = keys.strip().replace(" ", "")
            for section in keys.split(","):
                for key_name in section.split("+"):
                    keyboard.press(getattr(Key, key_name.lower(), key_name))
                for key_name in section.split("+"):
                    keyboard.release(getattr(Key, key_name.lower(), key_name))

        write = get_button_write(deck_id, page, key)
        if write:
            keyboard.type(write)

        brightness_change = get_button_change_brightness(deck_id, page, key)
        if brightness_change:
            change_brightness(deck_id, brightness_change)

        switch_page = get_button_switch_page(deck_id, page, key)
        if switch_page:
            set_page(deck_id, switch_page - 1) 
开发者ID:timothycrosley,项目名称:streamdeck-ui,代码行数:31,代码来源:api.py

示例5: __init__

# 需要导入模块: from pynput import keyboard [as 别名]
# 或者: from pynput.keyboard import Controller [as 别名]
def __init__(self, addr=DEFAULT_ADDR):
        self.reactor = None
        self.addr = addr
        self.running = False
        self.root = None
        self.keyboard = Controller() 
开发者ID:AirtestProject,项目名称:Poco,代码行数:8,代码来源:OSXUI.py

示例6: __init__

# 需要导入模块: from pynput import keyboard [as 别名]
# 或者: from pynput.keyboard import Controller [as 别名]
def __init__(self):
        self.keyboard = Controller() 
开发者ID:CedArctic,项目名称:Chimera,代码行数:4,代码来源:input_commands.py


注:本文中的pynput.keyboard.Controller方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。