Capture two keys at same time
Is there a way to capture 2 keys pressed at the same time? For example crtl and another key. Thanks for the reply.
No matter how quick you are, key events are received one at a time,
if you pressed 10 keys at once they would be processed in a queue.
When a keydown or keypress is handled you can look at
some boolean properties of the event:
ctrlKey,shiftKey,altKey each return true if the corresponding key was depressed
when the key event was handled.
Or you can build an array of key's on every keydown and wait to process them all when the next keyup event occurs.
Last edited by mrhoo; 12-20-2006 at 01:43 PM.
mrhoo and felgall
Thanks for the reply. I was not sure if the bool for the crtl, shift, and alt were actually triggered from false to true until the key was either up to down or down to up. And to the point of making an array, I suppose pushing and popping would not be bad either if you would want to use different keys. Thanks again for the replys. This forum has the best people invovlved you two being on the list obviously. Have a great holiday.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)