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

GAPI Hardware buttons iPAQ C#


GAPI Hardware buttons iPAQ C#

Postby bennie » Sep 27, 2002 @ 2:42am

OK, using the code below I press button2 and this disables the standard functions of the Hardware buttons If I press button3 these functions return.

My problem is I want to catch the keydown events of the hardware buttons.

I can do this for the arrow keys without any GAPI functions. However after calling GXOpen I cannot.
I then press button1(GXGetDefaultKeys) and my app closes?:?? without any error messages?? :(

any ideas or help is greatly appreciated. Please try to keep in .NET framework (which cannot use .h files)

[DllImport("gx.dll", EntryPoint="?OpenInput@@YAHXZ")]
private static extern int GXOpenInput();

[DllImport("gx.dll", EntryPoint="?GXCloseInput@@YAHXZ")]
private static extern int GXCloseInput();

[DllImport("gx.dll", EntryPoint="GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z")]
private static extern GXKeyList GXGetDefaultKeys(int i);

struct GXKeyList
{
short vkUp;
Point ptUp;
short vkDown;
Point ptDown;
short vkLeft;
Point ptLeft;
short vkRight;
Point ptRight;
short vkA;
Point ptA;
short vkB;
Point ptB;
short vkC;
Point ptC;
short vkStart;
Point ptStart;
};

private void button1_Click(object sender, System.EventArgs e)
{
GXKeyList gx_keylist;
gx_keylist = GXGetDefaultKeys(2);
}

private void button2_Click(object sender, System.EventArgs e)
{
GXOpenInput();
}

private void button3_Click(object sender, System.EventArgs e)
{
GXCloseInput();
}
bennie
 


GAPI Hardware buttons iPAQ C#

Postby Pacomac » Sep 28, 2002 @ 4:52pm

Pacomac
 


Postby refractor » Sep 28, 2002 @ 6:24pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby bennie » Sep 30, 2002 @ 12:10am

bennie
 


Postby Michael Y » Sep 30, 2002 @ 2:21am

User avatar
Michael Y
pm Insider
 
Posts: 1956
Joined: Feb 24, 2002 @ 2:27am


Postby sponge » Sep 30, 2002 @ 3:15am

holy internets batman.
User avatar
sponge
Not sponge
 
Posts: 12779
Joined: Jan 13, 2002 @ 8:04am
Location: New Hampshire


Postby refractor » Sep 30, 2002 @ 9:47am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby bennie » Sep 30, 2002 @ 10:45pm

bennie
 


Postby refractor » Sep 30, 2002 @ 11:25pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby bennie » Sep 30, 2002 @ 11:49pm

bennie
 


Postby refractor » Oct 1, 2002 @ 12:05am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


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