Page 1 of 1

GAPI Hardware buttons iPAQ C#

PostPosted: Sep 27, 2002 @ 2:42am
by bennie
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();
}

GAPI Hardware buttons iPAQ C#

PostPosted: Sep 28, 2002 @ 4:52pm
by Pacomac

PostPosted: Sep 28, 2002 @ 6:24pm
by refractor

PostPosted: Sep 30, 2002 @ 12:10am
by bennie

PostPosted: Sep 30, 2002 @ 2:21am
by Michael Y

PostPosted: Sep 30, 2002 @ 3:15am
by sponge

PostPosted: Sep 30, 2002 @ 9:47am
by refractor

PostPosted: Sep 30, 2002 @ 10:45pm
by bennie

PostPosted: Sep 30, 2002 @ 11:25pm
by refractor

PostPosted: Sep 30, 2002 @ 11:49pm
by bennie

PostPosted: Oct 1, 2002 @ 12:05am
by refractor