I don't really know how word the question but I want the "h" or "j" or "k" inputs to display their respective values
from pynput.keyboard import Key, Controller
import time
import random
keyboard = Controller()
wasd = ["w","a","s","d","j","h","k"]
for x in range(1,11):
if wasd[random.randint(0,6)] == "w":
keyboard.press("w")
time.sleep(0.5)
keyboard.release("w")
elif wasd[random.randint(0,6)] == "a":
keyboard.press("a")
time.sleep(1)
keyboard.release("a")
elif wasd[random.randint(0,6)] == "s":
keyboard.press("s")
time.sleep(0.1)
keyboard.release("s")
elif wasd[random.randint(0,6)] == "d":
keyboard.press("d")
time.sleep(1)
keyboard.release("d")
elif wasd[random.randint(0,6)] == "h" or "j" or "k":
keyboard.press("h" or "j" or "k")
time.sleep(0.03)
keyboard.release("h" or "j" or "k")
here is the code and this is the output: shdhswhhhh
so whenever its either h, j or k it only types h