22 if (prevState.mouseInfo.bmLeftButton == 0 && pmi->
bmLeftButton == 1)
25 if (prevState.mouseInfo.bmLeftButton == 1 && pmi->
bmLeftButton == 0)
28 if (prevState.mouseInfo.bmRightButton == 0 && pmi->
bmRightButton == 1)
31 if (prevState.mouseInfo.bmRightButton == 1 && pmi->
bmRightButton == 0)
34 if (prevState.mouseInfo.bmMiddleButton == 0 && pmi->
bmMiddleButton == 1)
37 if (prevState.mouseInfo.bmMiddleButton == 1 && pmi->
bmMiddleButton == 0)
40 if (prevState.mouseInfo.dX != pmi->
dX || prevState.mouseInfo.dY != pmi->
dY)
44 for (uint8_t i = 0; i<
sizeof (
MOUSEINFO); i++)
45 prevState.bInfo[i] = buf[i];
60 for (uint8_t i = 2; i < 8; i++) {
64 for (uint8_t j = 2; j < 8; j++) {
65 if (buf[i] ==
prevState.bInfo[j] && buf[i] != 1)
77 for (uint8_t i = 0; i < 8; i++)
102 const uint8_t KeyboardReportParser::numKeys[] PROGMEM = {
'!',
'@',
'#',
'$',
'%',
'^',
'&',
'*',
'(',
')'};
103 const uint8_t KeyboardReportParser::symKeysUp[] PROGMEM = {
'_',
'+',
'{',
'}',
'|',
'~',
':',
'"',
'~',
'<',
'>',
'?'};
104 const uint8_t KeyboardReportParser::symKeysLo[] PROGMEM = {
'-',
'=',
'[',
']',
'\\',
' ',
';',
'\'',
'`',
',',
'.',
'/'};
105 const uint8_t KeyboardReportParser::padKeys[] PROGMEM = {
'/',
'*',
'-',
'+', 0x13};
108 uint8_t shift = (mod & 0x22);
111 if (key > 0x03 && key < 0x1e) {
115 return (key - 4 +
'A');
119 return (key - 4 +
'a');
121 else if (key > 0x1d && key < 0x27) {
123 return ((uint8_t)pgm_read_byte(&numKeys[key - 0x1e]));
125 return (key - 0x1e +
'1');
127 else if (key > 0x58 && key < 0x62) {
129 return (key - 0x59 +
'1');
130 }
else if (key > 0x2c && key < 0x39)
131 return ((shift) ? (uint8_t)pgm_read_byte(&symKeysUp[key - 0x2d]) : (uint8_t)pgm_read_byte(&symKeysLo[key - 0x2d]));
132 else if (key > 0x53 && key < 0x59)
133 return (uint8_t)pgm_read_byte(&padKeys[key - 0x54]);
138 case KEY_ZERO:
return ((shift) ?
')':
'0');
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)
union KeyboardReportParser::@14 kbdLockingKeys
union KeyboardReportParser::@13 prevState
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 void OnLeftButtonUp(MOUSEINFO *mi)
virtual void OnMouseMove(MOUSEINFO *mi)
virtual void OnRightButtonUp(MOUSEINFO *mi)
virtual void OnMiddleButtonDown(MOUSEINFO *mi)
virtual void OnControlKeysChanged(uint8_t before, uint8_t after)
virtual void OnLeftButtonDown(MOUSEINFO *mi)
uint8_t OemToAscii(uint8_t mod, uint8_t key)