question

Azrael III
07-21-2003, 09:19 AM
is it possible to convert the KeyCode of KeyDown-event into the real keynames?

Mikecrosoft
07-21-2003, 09:25 AM
Real Names: I Suppouse, when keycode its vbKeyReturn (Enter), print in some place ENTER.

Well, just use a select case for each KeyCode:


Select Case KeyCode
case vbKeyReturn
Msgobx "ENTER"

case "vbKeyEscape"
Msgbox "ESCAPE"

...... etc etc

End Select


I hope thats your answer.

SteRobson
07-21-2003, 09:25 AM
is it possible to convert the KeyCode of KeyDown-event into the real keynames?

Do you mean the names such as "vbKeyUp" or the corresponding characters? You can convert the KeyCode to a character by using:

chr(KeyCode)

Hope this helps ;)

Tweakish
07-21-2003, 09:25 AM
are vbKeyUp and vbKeyDown so hard to use?

Azrael III
07-21-2003, 09:33 AM
yes your all right but i hope there must be a better way then typing all 99 keys

Mikecrosoft
07-21-2003, 09:34 AM
who is right ? :D

Azrael III
07-21-2003, 09:35 AM
who is right ? :D

all in all you all said the same

Mikecrosoft
07-21-2003, 09:40 AM
One "quick" way its to fill a array (stirng) with the Key Name and in the corresponding array position with the keynumber (ASCII)

Dim myKeys(255) as Stirng

Example
MyKeys(13) = "SPACE"
MyKeys(32) = "ESCAPE"
....
...

then only in the KeyPress or KeyDown events use this

Msgbox "Key Pressed:" & MyKeys(KeyCode)


I hope that help to you

Azrael III
07-21-2003, 09:45 AM
impossile
i already tried bufferoverflow

Mikecrosoft
07-21-2003, 09:48 AM
Overflow, why?, how many keys you have ?

Azrael III
07-21-2003, 09:52 AM
my keyboard has 99

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum