[SOLVED] Binding to ctrl-key combinations

Hey,



I am trying to bind to a specific key combination (ctrl-q) in my case, but cannot find a direct way of doing it. I tried many different ways of creating a KeyTrigger, using the key values for LControl and Q with “&”, “|”, “^” and “+” but all of them to no avail.



For now, I think the only solution is to have a generic listener for LControl which tracks if control is down or not and sets a variable, and then check that variable from the Q listener. Is this the correct approach? Did I oversee something here?



Thanks.

Corintho

yeh i think normally, you listen for key events, a, b, c, d etc… and in there you check if the ctrl key has been pressed, using a boolean or something

@corintho: I don’t know if you know about it, but if you create a TestProject and go to TestComboMoves.java(or something like this) you will see exaclty what you are looking for xD.

@glaucomardano



I just took a look at it. Although it seems a little bit overkill for my “Ctrl-Q” it will surely make things much easier down the road for me when I need to handle other things.



Thank you very much.

TestComboMoves shows how to do it. If your application relies on these kinds of hotkeys then its the best option right now.

Yes,



I will actually make a simpler code for just ctrl-key, alt-key and shift-key. With an approach inspired by the TestComboMoves, and will keep that code around for more complex things later on the development cycle.



Thanks for the input.