當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。