apk
This commit is contained in:
parent
b690c1720f
commit
32978058c1
|
@ -1,13 +1,15 @@
|
||||||
import keyboard
|
import keyboard
|
||||||
|
import pyautogui
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("Press keys on your keyboard to see their mapping. Press 'q' to quit.")
|
print("Press keys on your keyboard to see their mapping. Press 'q' to quit.")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
event = keyboard.read_event()
|
key = keyboard.read_event(suppress=True).name
|
||||||
if event.event_type == keyboard.KEY_DOWN:
|
if key == "q":
|
||||||
print(f"Key: {event.name}, Character: {event.scan_code}")
|
break
|
||||||
|
print(f"Key: {key}, Character: {pyautogui.KEYBOARD_KEYS.get(key, 'No mapping')}")
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("\nExiting...")
|
print("\nExiting...")
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue