Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > key sequence question

Reply
Thread Tools

key sequence question

 
 
Frank L.
Guest
Posts: n/a
 
      07-10-2003
Hi. I have this key sequence detection:

keySeq = 0

function keyHandler() {

switch (event.keyCode) {
case 78:
if (keySeq==0) {keySeq++}
break
case 65:
if (keySeq==1) {keySeq++}
keySeq = 2
break
case 82:
if (keySeq==2) {keySeq++}
keySeq = 2
break
case 85:
if (keySeq==2)
alert("Hello")
keySeq = 0
}
}


Is there a way I could put in an 'if' statement so I could say basically "if
this sequence of keys is pressed, do this action, else if do something else,
else if....etc, etc.

Thanks
Frank


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to define a key which generates unique sequence number? XML fellow XML 2 10-03-2008 11:05 AM
how to iterate over sequence and non-sequence ? stef mientki Python 13 10-20-2007 10:21 AM
Replace Tab Key to Return Key (Enter Key) from Web Forms? M P ASP General 1 08-06-2004 08:32 AM
BOOT SEQUENCE (how to change boot sequence) bird Computer Support 13 12-24-2003 02:20 AM



Advertisments