Reputation: 33
I want to make something so whenever you press any key, it will type something else.
I have tried to make a list of all letters but that didnt work
I want to use this command
while True:
if keyboard.is_pressed('a')
print(list(text[1]))
but i want it to work like this
if keyboard.is_pressed('any key')
Upvotes: 3
Views: 1006
Reputation: 676
Read the doceument that palvarez recommended because the answer is in there.
I have done it here for you:
import keyboard
while True:
if keyboard.read_hotkey():
print("you have pressed a key")
Upvotes: 2