Reputation: 47
is there a way to detect if ENTER is pressed with python? I was able to detect letters with win32api using win32api.GetAsyncKeyState(ord('H'))
, but couldn't do the same with enter. I need to run the code on windows.
Thanks.
Upvotes: 0
Views: 1295
Reputation: 11
You can use keyboard lib.
pip3 install keyboard
import keyboard
if keyboard.read_key() == "enter":
...
https://github.com/boppreh/keyboard
Upvotes: 1