@ Tempered, Can you be more specific than “crash”. Is there an error message or does the program just stop working? Can you post the code that interprets the PS/2 input?
The below is the code. The connect event fires. It also links the events to the object instance… Just no events ever fire. Before i removed the USBHost object on the designer i was getting USB Device not supported.
public partial class Program
{
USBH_Keyboard KeyB = null;
GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
//Ascended.Helpers.UsbDiscoveryHelper Helper = new Ascended.Helpers.UsbDiscoveryHelper();
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
char_Display.PrintString("Hello");
//USBHostController.DeviceConnectedEvent += USBHostController_DeviceConnectedEvent;
USBHostController.DeviceConnectedEvent += USBHostController_DeviceConnectedEvent;
// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
Debug.Print("Program Started");
}
void USBHostController_DeviceConnectedEvent(USBH_Device device)
{
if (device.TYPE == USBH_DeviceType.Keyboard)
{
KeyB = new USBH_Keyboard(device);
KeyB.CharDown += KeyB_CharDown; //these commands DO execute
KeyB.CharUp += KeyB_CharUp;
KeyB.Disconnected += KeyB_Disconnected;
KeyB.KeyDown += new USBH_KeyboardEventHandler(KeyB_KeyDown);
KeyB.KeyUp += KeyB_KeyUp;
}//catch
{}
}
void KeyB_Disconnected(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
throw new NotImplementedException(); //NEVER EXECUTES
}
void KeyB_CharUp(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
throw new NotImplementedException();//NEVER EXECUTES
}
void KeyB_CharDown(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
throw new NotImplementedException();//NEVER EXECUTES
}
void KeyB_KeyDown(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
throw new NotImplementedException();//NEVER EXECUTES
}
void KeyB_KeyUp(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
Debug.Print(args.Key.ToString());//NEVER EXECUTES
}