I'm trying to check if the key "q" is pressed whilst running a tkinter loop. Is there a way to do this?
from tkinter import *
import keyboard
def DetectKeyPress():
if keyboard.read_key() == "p":
print("you pressed p!")
root = Tk()
DetectKeyPress()
root.mainloop()