This site is no longer active and is available for archival purposes only. Registration and login is disabled.

eVB d-pad recognition


eVB d-pad recognition

Postby Matt Gifford » Mar 29, 2003 @ 12:32am

How do I use the d-pad in my eVB program?
User avatar
Matt Gifford
pm Member
 
Posts: 369
Joined: Feb 23, 2002 @ 7:48am
Location: Snoqualmie, Washington


Postby Dan East » Mar 29, 2003 @ 5:08am

It produces key messages just like the arrow keys on a PC. Keycodes are VK_UP, VK_RIGHT, etc.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Matt Gifford » Mar 29, 2003 @ 5:11am

User avatar
Matt Gifford
pm Member
 
Posts: 369
Joined: Feb 23, 2002 @ 7:48am
Location: Snoqualmie, Washington


Postby Matt Gifford » Mar 29, 2003 @ 6:23am

User avatar
Matt Gifford
pm Member
 
Posts: 369
Joined: Feb 23, 2002 @ 7:48am
Location: Snoqualmie, Washington


Postby Jarin » Mar 29, 2003 @ 7:44am

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
Jarin
 


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron