Ask coding questions

← Back to all posts
How do I put a hotkey so the drawing tool can change color? (this is pygame btw)
Foxyboi1 (0)

i really need to do this of a class, but i cant figure it out so i was wondering if you could help me?

Comments
hotnewtop
MikeJMS8910 (160)

https://www.codegrepper.com/code-examples/python/check+key+pressed+pygame - this would be for checking if a key is pressed and if you want it so that the key can be custom you just make the key that you want to check if it is pressed to a variable. Then in the function, if the key is pressed then you can just change the color. I hope this helps.