We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have an image button of a piano key, and I have it set to where if it is not clicked, it is white, if it is hovered over it is light grey, and if it is pressed it is medium grey. I would also like to have it change to the medium grey color if a specific key on the keyboard is pressed. How would I do this?
Answers
Check these
https://forum.processing.org/one/topic/control-p5-changing-mouseover-color-font-size-font.html
http://www.sojamo.de/libraries/controlP5/examples/use/ControlP5mouseover/ControlP5mouseover.pde
Also click on the button labeled colorC to see a change in the background color of colorA button. It is not a full example of what you want to do but it might come handy.
Kf
Thank you for the code. I actually ended up finding a much easier way to do what I wanted to do though by using the image toggle button from the G4P library.