“Python Pynput Hotkeys” Code-Antworten

Pynput.Keyboard.Key

# here are all the attrebutes of pynput.keyboard.Key 
[
    'alt', 'backspace', 'cmd', 'ctrl', 'delete', 'down', 'end', 'enter',
    'esc', 'f1', 'f10', 'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18',
    'f19', 'f2', 'f20', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'home',
    'insert','left', 'menu', 'pause', 'right', 'shift', 'space', 'tab', 'up'
    ]
Cloudy Cat

Python Pynput Hotkeys

from pynput import keyboard

def on_activate_h():
    print('<ctrl>+<alt>+h pressed')

def on_activate_i():
    print('<ctrl>+<alt>+i pressed')

with keyboard.GlobalHotKeys({
        '<ctrl>+<alt>+h': on_activate_h,
        '<ctrl>+<alt>+i': on_activate_i}) as h:
    h.join()
Friendly Fly

Ähnliche Antworten wie “Python Pynput Hotkeys”

Fragen ähnlich wie “Python Pynput Hotkeys”

Weitere verwandte Antworten zu “Python Pynput Hotkeys” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen