How to detect key press event and key hold down event without using pygame
问题 I am currently looking for a library that is able to detect/monitor the keyboard. My intention is to detect when a key is being held down and while it occurs something should happen. Most SO posts suggest to use pygame, but i find it a bit too much, to involve a library such as that for this simple task. i've also tried with pynput , which resulted only detecting one press rather than a stream of presses. any suggestions on how i can make this while loop detect a key is being pressed / held