Here is just a bit of java info.
Java never "constantly" runs. Never. You can't program that (well you probably could but it's not how it works). What happens is you set the Boolean pressed to true, so it runs a class or etc. and then you check the Boolean throughout the code to make sure it is true, if it isn't, program the code to disregard the events that took place and to start over at Boolean pressed true when the keybind is pressed again.
NOTE: When I say disregard, I don't mean erase what happened due to the result of pressing the keybind, I mean to literally pretend it didn't happen (even though it did happen) and start over.
All of this is a bit hard to explain, but the point stand (if you can understand my mumbo-jumbo).