Answer the question
In order to leave comments, you need to log in
How to handle keypresses in python?
How to do something similar to "pygame.event.get()"? Didn't find the info I needed anywhere. It is desirable to need a structure something like in pygame, more precisely something like this:
for e in pygame.event.get():
print(e)
Answer the question
In order to leave comments, you need to log in
can be used directly:
import msvcrt
msvcrt.getch() # вернет строку байтовую
import win32api as wapi
keyList = ["\b"]
for char in "ABCDEFGHIJKLMNOPQRSTUVWXYZ 123456789,.'£$/\\":
keyList.append(char)
def key_check():
keys = []
for key in keyList:
if wapi.GetAsyncKeyState(ord(key)):
keys.append(key)
return keys
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question