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();
}