How can i use kbhit function in getch, when I am using getch library in Python and using Linux? I found kbhit function in msvcrt library, but I do not use msvcrt, because it is only for Windows and i cannot found anything for getch library.
This is my code right now:
import getch
import threading
def onkey():
while getch.kbhit():
input = str(getch.getch())
print(input)
t = threading.Thread(target=onkey)
t.daemon = True
t.start()
KBHIT - "Returns True if keyboard character was hit, False otherwise."
So when you press any key it will return True. If you want to know which key you've pressed: