Пример #1
0
 static void DeviceConnectedEvent(USBH_Device device)
 {
     if (device.TYPE == USBH_DeviceType.Keyboard)
     {
         _keyboard          = new USBH_Keyboard(device);
         _keyboard.KeyDown += _keyboard_KeyDown;
         _keyboard.KeyUp   += _keyboard_KeyUp;
         Debug.Print("Keyboard attached");
     }
     else if (device.TYPE == USBH_DeviceType.Mouse)
     {
         _mouse = new USBH_Mouse(device);
         _mouse.SetCursorBounds(0, Core.ScreenWidth, 0, Core.ScreenHeight);
         _mouse.SetCursor(0, 0);
         _mouse.Scale(20);
         _mouse.MouseMove   += _mouse_MouseMove;
         _mouse.MouseDown   += _mouse_MouseDown;
         _mouse.MouseUp     += _mouse_MouseUp;
         Core.MouseAvailable = true;
         Debug.Print("Mouse attached");
     }
 }