Page 1 of 1

eVB d-pad recognition

PostPosted: Mar 29, 2003 @ 12:32am
by Matt Gifford
How do I use the d-pad in my eVB program?

PostPosted: Mar 29, 2003 @ 5:08am
by Dan East
It produces key messages just like the arrow keys on a PC. Keycodes are VK_UP, VK_RIGHT, etc.

Dan East

PostPosted: Mar 29, 2003 @ 5:11am
by Matt Gifford

PostPosted: Mar 29, 2003 @ 6:23am
by Matt Gifford

PostPosted: Mar 29, 2003 @ 7:44am
by Jarin
Here is some code I used before hope it helps

we have the GetAsyncKeyState function which makes it possible to turn over the state of the key whose code passed in parameter. This function is in the Coredll bookshop and is declared in the following way:

Public Declare Function GetAsyncKeyState Lib "Coredll" (ByVal vKey As Long) As Boolean

We declare these values in the form of constants in eVB:

Const VK_LBUTTON = &H1
Const VK_UP = &H26
Const VK_RIGHT = &H27
Const VK_DOWN = &H28
Const VK_LEFT = &H25
Const VK_F23 = &H86

Example: To recover the state of the key Action of the PAD

Dim wEtat as Boolean

wEtat = GetAsyncKeyState(VK_F23)
If wEtat Then Call MsgBox("you touched action on D PAD.")

Or, we can check if the stylet is in contact with the screen:

wEtat = GetAsyncKeyState(VK_LBUTTON)

The Complete list of codes for each key press is below

VK_LBUTTON & h1 Activated pointer
VK_UP & h26 PAD upwards
VK_RIGHT & h27 PAD towards the right
VK_DOWN & h25 PAD downwards
VK_LEFT & h25 PAD towards the left
VK_F23 & h86 Button Action of the PAD


of course this has to be used within a proper program etc but this should get you going, hope it helps!

- Jarin