public unsafe IUSBDriver Load(USBDevice device) { USBInterfaceDescriptor *desc = device.InterfaceDesc; if (!(desc->Class == (byte)USBClassCodes.HID && desc->SubClass == 0x01 && desc->Protocol == 0x01)) { return(null); } device.Classifier = USBDeviceClassifier.FUNCTION; USBHIDKeyboard kb = new USBHIDKeyboard(); kb.initDevice(device); return(kb); }
public static void Init() { USBHIDKeyboard keyboard = new USBHIDKeyboard(); USBDrivers.RegisterDriver(keyboard); }