25 if (prevState.mouseInfo.bmLeftButton == 0 && pmi->
bmLeftButton == 1)
28 if (prevState.mouseInfo.bmLeftButton == 1 && pmi->
bmLeftButton == 0)
31 if (prevState.mouseInfo.bmRightButton == 0 && pmi->
bmRightButton == 1)
34 if (prevState.mouseInfo.bmRightButton == 1 && pmi->
bmRightButton == 0)
37 if (prevState.mouseInfo.bmMiddleButton == 0 && pmi->
bmMiddleButton == 1)
40 if (prevState.mouseInfo.bmMiddleButton == 1 && pmi->
bmMiddleButton == 0)
43 if (prevState.mouseInfo.dX != pmi->
dX || prevState.mouseInfo.dY != pmi->
dY)
47 for (uint8_t i = 0; i<
sizeof (
MOUSEINFO); i++)
48 prevState.bInfo[i] = buf[i];
68 if(prevState.mouseInfo.bmLeftButton != pmi->
bmLeftButton ) {
108 if(pmi->
dX || pmi->
dY) {
122 prevState.bInfo[0] = buf[0];
135 if (
prevState.bInfo[0x00] != buf[0x00]) {
139 for (uint8_t i = 2; i < 8; i++) {
143 for (uint8_t j = 2; j < 8; j++) {
144 if (buf[i] ==
prevState.bInfo[j] && buf[i] != 1)
156 for (uint8_t i = 0; i < 8; i++)
181 const uint8_t KeyboardReportParser::numKeys[10] PROGMEM = {
'!',
'@',
'#',
'$',
'%',
'^',
'&',
'*',
'(',
')'};
182 const uint8_t KeyboardReportParser::symKeysUp[12] PROGMEM = {
'_',
'+',
'{',
'}',
'|',
'~',
':',
'"',
'~',
'<',
'>',
'?'};
183 const uint8_t KeyboardReportParser::symKeysLo[12] PROGMEM = {
'-',
'=',
'[',
']',
'\\',
' ',
';',
'\'',
'`',
',',
'.',
'/'};
184 const uint8_t KeyboardReportParser::padKeys[5] PROGMEM = {
'/',
'*',
'-',
'+', 0x13};
187 uint8_t shift = (mod & 0x22);
194 return (key - 4 +
'A');
198 return (key - 4 +
'a');
202 return ((uint8_t)pgm_read_byte(&
getNumKeys()[key - 0x1e]));
208 return (key - 0x59 +
'1');
210 return ((shift) ? (uint8_t)pgm_read_byte(&
getSymKeysUp()[key - 0x2d]) : (uint8_t)pgm_read_byte(&
getSymKeysLo()[key - 0x2d]));
212 return (uint8_t)pgm_read_byte(&
getPadKeys()[key - 0x54]);
#define UHS_HID_BOOT_KEY_PERIOD
virtual const uint8_t * getSymKeysLo()
virtual void OnRightButtonDown(MOUSEINFO *mi)
virtual void OnKeyDown(uint8_t mod, uint8_t key)
uint8_t SetReport(uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr)
virtual void OnMiddleButtonUp(MOUSEINFO *mi)
virtual uint8_t HandleLockingKeys(HID *hid, uint8_t key)
virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
#define UHS_HID_BOOT_KEY_ZERO2
#define UHS_HID_BOOT_KEY_SCROLL_LOCK
union KeyboardReportParser::@14 kbdLockingKeys
union KeyboardReportParser::@13 prevState
#define UHS_HID_BOOT_KEY_ZERO
virtual void OnKeyUp(uint8_t mod, uint8_t key)
virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
virtual const uint8_t * getSymKeysUp()
virtual void OnLeftButtonUp(MOUSEINFO *mi)
#define UHS_HID_BOOT_KEY_SPACE
virtual void OnMouseMove(MOUSEINFO *mi)
virtual void OnRightButtonUp(MOUSEINFO *mi)
#define VALUE_WITHIN(v, l, h)
virtual void OnMiddleButtonDown(MOUSEINFO *mi)
#define UHS_HID_BOOT_KEY_NUM_LOCK
#define UHS_HID_BOOT_KEY_ENTER
virtual void OnControlKeysChanged(uint8_t before, uint8_t after)
virtual void OnLeftButtonDown(MOUSEINFO *mi)
virtual const uint8_t * getNumKeys()
virtual const uint8_t * getPadKeys()
#define UHS_HID_BOOT_KEY_CAPS_LOCK
uint8_t OemToAscii(uint8_t mod, uint8_t key)