“Python Pynput Hotkeys” Kode Jawaban

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

Jawaban yang mirip dengan “Python Pynput Hotkeys”

Pertanyaan yang mirip dengan “Python Pynput Hotkeys”

Lebih banyak jawaban terkait untuk “Python Pynput Hotkeys” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya