think user pressed two keys at same time .
I want to be notified of this two keys , not one .
like Up + Left
how can I find out this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you should register handlers for the keyup and keydown events.
for each key involved in your key combination, you store a flag which tells if the key is up or down. each time you receive a keydown event for one of those keys, you set the flags, each time you receive a keyup event, you reset the flag (set it back to 0).
when all the flags are set, it means that all the keys for the combination are pressed at the same time, you can then call a function of your choice to react on this event.