GyverLibs / EasyHID

Библиотека программного USB клавиатуры и мыши для Arduino Nano/UNO/Mega и прочих
MIT License
113 stars 23 forks source link

Ошибка определения статуса LED Numlock, CapsLock, ScrollLock #19

Closed OzhegovRoman closed 1 year ago

OzhegovRoman commented 1 year ago

В файле HIDPrivate.c необходимо сделать изменения:

usbMsgLen_t usbFunctionSetup(uint8_t data[8]) ... case USBRQ_HID_SET_REPORT: if (rq->wLength.word == 2) // check data is available { // 1 byte, we don't check report type (it can only be output or feature) // we never implemented "feature" reports so it can't be feature // so assume "output" reports // this means set LED status // since it's the only one in the descriptor return USB_NO_MSG; // send nothing but call usbFunctionWrite } ... usbMsgLen_t usbFunctionWrite(uint8_t * data, uchar len) { //for Keyboard if (data[0] == REPID_KEYBOARD) led_state = data[1]; return 2; // 1 byte read }

К сожалению не умею создавать Pull request, а так бы закинул сразу же к вам это исправление