def pressLetter(charIn):
val = getKeyValue(charIn)
PressKey(val)
return
def KeyboardEvents():
from pynput import keyboard
with keyboard.Events() as events:
for event in events:
if event.key == keyboard.Key.space:
pressLetter('w')
Pressing space types ww. How would I rewrite this so that it only presses w once?