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


Python Key.esc方法代码示例

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


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

示例1: onKeyRelease

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def onKeyRelease(key):
    global keys, charCount  #Access global variables
    if key == Key.esc:
        writeToFile()
        return False
    else:
        if key == Key.enter:    #Write keys to file
            writeToFile()
        elif key == Key.space:  #Write keys to file
            key = ' '
            writeToFile()
        keys.append(key)    #Store the Keys
        charCount += 1      #Count keys pressed 
开发者ID:Ajinkya-Sonawane,项目名称:Python,代码行数:15,代码来源:19_KeyLogger.py

示例2: _keyboard_on_press

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def _keyboard_on_press(self, key):
        from pynput.keyboard import Key
        if key == Key.esc:
            self._terminate = True
            return False

        action = self._key_to_action(key)
        if action is not None:
            if action not in self._current_actions:
                self._current_actions.append(action) 
开发者ID:alex-petrenko,项目名称:sample-factory,代码行数:12,代码来源:doom_gym.py

示例3: user_input

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def user_input(self):
        if self.keys[Key.esc]:
            self.running = False
            return
        if self.keys[KeyCode(char='t')]:
            self.renderer.textures_on = not self.renderer.textures_on
            self.keys[KeyCode(char='t')] = False
        self.movement() 
开发者ID:salt-die,项目名称:terminal_dungeon,代码行数:10,代码来源:controller.py

示例4: released

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def released(self, key):
        if key == Key.esc:
            return False
        self.keys[key] = False 
开发者ID:salt-die,项目名称:terminal_dungeon,代码行数:6,代码来源:controller.py

示例5: on_release

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def on_release(key):
    global exit
    if key == Key.esc:
        exit += 1
        if exit == 5 :
            return False 
开发者ID:smahesh29,项目名称:Django-WebApp,代码行数:8,代码来源:main.py

示例6: on_release

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def on_release(key):
    # print('{0} release'.format(key))
    if key == Key.esc:
        # Stop listener
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:7,代码来源:test.py

示例7: is_ctrl_winchrome

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_ctrl_winchrome(key):
    if key == Key.ctrl:
        # print(str(key).replace("Key.", "").title() +' successfully mapped to physical Alt key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Alt is now Ctrl')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Alt key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例8: is_ctrl_mac

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_ctrl_mac(key):
    if key == Key.ctrl:
        # print(str(key).replace("Key.", "").title() +' successfully mapped to physical Alt key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Command is now Ctrl')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Command key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例9: is_ctrl_terminal

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_ctrl_terminal(key):
    if key == Key.ctrl:
        # print(str(key).replace("Key.", "").title() +' successfully mapped to physical Ctrl key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Ctrl remains Ctrl,\nwhile in terminal apps.')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Ctrl key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例10: is_alt_chromebook

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_alt_chromebook(key):
    if key == Key.alt:
        # print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Ctrl key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Ctrl is now Alt')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Ctrl key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例11: is_alt_mac

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_alt_mac(key):
    if key == Key.alt:
        # print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Ctrl key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Alt remains Alt')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Alt key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例12: is_alt_chromebook_terminal

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_alt_chromebook_terminal(key):
    if key == Key.alt:
        # print(str(key).replace("Key.", "").title() +' successfully mapped to the physical Search key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Search is now Alt,\nwhile in terminals apps.')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Search key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例13: is_super_winmac

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_super_winmac(key):
    if key == Key.cmd:
        # print('Super/Win successfully mapped to the physical Search key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Ctrl key is Super/Win')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Ctrl key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例14: is_super_chromebook

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_super_chromebook(key):
    if key == Key.cmd:
        # print('Super/Win successfully mapped to the physical Search key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Search key is Super/Win')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Search key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py

示例15: is_super_terminal

# 需要导入模块: from pynput.keyboard import Key [as 别名]
# 或者: from pynput.keyboard.Key import esc [as 别名]
def is_super_terminal(key):
    if key == Key.cmd:
        # print('Super/Win successfully mapped to the physical Alt key.'.format(key))
        print(color.GREEN + 'Success' + color.END + ' Alt is now Super/Win,\nwhile in terminal apps.')
        return False
    elif key == Key.esc:
    	return False
    else:
        print('keymap failure, ' + str(key).replace("Key.", "").title() + ' may have been mapped to the physical Alt key.'.format(key))
        return False 
开发者ID:rbreaves,项目名称:kinto,代码行数:12,代码来源:test.py


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