PDA

View Full Version : simultaneous keycode detection


kwhubby
12-13-2002, 07:40 AM
IS there a way to determine multiple keys pressed at the same time, (like SHIFT + q) but not with the wierd little individual event for the SHIFT (what ever it is SHIFTLOCK or whatever) and the keycode detectiong for q, but by detecting all the keycode pressings at the same time, so to be able to detect something like x + 5 in keycodes
I would like this for my game which I am working on, and uses arrow keys, but can only detect if one is pressed down, not two at the same time.

glenngv
12-13-2002, 08:00 AM
you've ask this similar thing in the previous thread:
http://codingforums.com/showthread.php?s=&threadid=9304

and didn't this link help which I posted in that thread?
http://www.webreference.com/js/column11/modifierkeys.html

kwhubby
12-13-2002, 08:59 PM
I was trieng to figure out instead of something like window.event.shiftKey; and a detection for a keycode key
wich only works with detecting two keys with just the SHIFT, Ctrl, or ALt, and one keycode key. I want to detect if two non modifer keys are pressed, such as c + x at the same time, detecting with key codes.

kwhubby
12-13-2002, 09:07 PM
would it be as simple as something like
var a = (window.event.keyCode == 39 & window.event.keyCode == 37)

would that work?