Skystynger
11-04-2001, 03:19 AM
what is the keyAscii for the arrow keys?
Key AsciiSkystynger 11-04-2001, 03:19 AM what is the keyAscii for the arrow keys? Squirm 11-04-2001, 03:46 AM There is no keyASCII for the arrow keys. You use keyASCII with the KeyPress event. I would suggest using the KeyUp and KeyDown events: <pre>Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyUp 'do something to go up Case vbKeyDown 'move down Case vbKeyLeft 'left Case vbKeyRight 'right End Select End Sub</pre> wild wolf 11-04-2001, 09:19 AM i mdae this game in Macromedia Director which used VB for connectivity for network, in that i used ASCII codes, iam not sure at the moment what they were, i guess they were 123, 124, 125, 126 iam not sure which ascii is for which, try it out, it may work, if does not let me know, i will confirm the ascii's for u Thinker 11-04-2001, 09:30 AM In spite of what you may have done with Macromedia Director, Squirm is correct that the arrow keys are NOT returned in KeyAscii in the KeyPress Event. Squirm is also correct that they must be trapped in a KeyDown or KeyUp event. wild wolf 11-04-2001, 09:48 AM iam sorry if i had replied a wrong answer, actually even i had used the vbkeyup and was about to reply accordingly, but when i read he wanted ascii codes, i thought maybe these would work, oooops Squirm 11-04-2001, 09:52 AM And if you do not believe me then try this: <pre>Private Sub Form_KeyPress(KeyAscii As Integer) Debug.Print "You pressed a key : " & KeyAscii End Sub</pre> try this with the arrow keys and you will see, those keys do not even trigger the event. wild wolf 11-04-2001, 10:08 AM no comments buddy on something that i tried on a different platform (director), i hope i did not mislead skystynger lmb2001 11-04-2001, 06:58 PM thanks dood I needed to ask that as well.... |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum