dpressed = 0 def on_press(key): if key == (\'d\'): global dpressed dpressed+=1 logging.info(\"D: %s\" % dpressed)
Whe
For anyone else that may have this problem, I imported KeyCode from pynput.keybord at the top. Then I changed ('d') to KeyCode.from_char('d'). This should work for anyone with this problem. There is a great explanation here