posted 19 years ago
I want my GUI to have a set of button that are invisible to the regular user, but that "super users" can type in F2, 9, ctrl-page up, F10 (some random sequence of key strokes) to make appear additional buttons. I guess I want a trapdoor, like in video games where you have to do up-up-left-up-right to get some cool upgrade. How should I go about doing this?
I found something online about key binding, so I figured I could key bind all of the above key strokes to one action method that would check if the entire sequence has been typed, which would trigger a setVisible(true) function to be called.
However, I can't even make the key binding work! So far, I have:
My "System.out.println( input );" statement never even happens! How can I make this key binding work, and is that the best way to go about doing this?
I know I could just create a key listener that would check all typed keys for the special characters, but I think that's a real waste of time. (this listener would be called EVERY time any user typed any letter and would not be effecient!)
Let me know if you know how to make my key binding work, or if you think there's a better way to go about doing this!
Thanks!
Kate