We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b218c1e commit a3e9b0bCopy full SHA for a3e9b0b
tests/manual-test.py
@@ -7,12 +7,16 @@
7
known_keys = {v: k for k, v in reversed(vars(key).items()) if not k.startswith("__")}
8
9
10
-while True:
11
- data = readkey()
+def main():
+ while True:
12
+ read_key = readkey()
13
+ mykey = f"got {known_keys[read_key]}" if read_key in known_keys else read_key
14
- if data in known_keys:
- print(f"got {known_keys[data]}", end="")
15
- else:
16
- print(data, end="")
+ print(f"{mykey} - 0x{ read_key.encode().hex() }")
17
18
- print(" - " + "".join([f"\\x{ord(c):02x}" for c in data]))
+
+if __name__ == "__main__":
19
+ try:
20
+ main()
21
+ except KeyboardInterrupt:
22
+ print("\nKeyboardInterrupt")
0 commit comments