19 void MouseReportParser::Parse(
USBHID *hid __attribute__((unused)),
bool is_rpt_id __attribute__((unused)), uint8_t len __attribute__((unused)), uint8_t *buf) {
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++)
160 const uint8_t KeyboardReportParser::numKeys[10] PROGMEM = {
'!',
'@',
'#',
'$',
'%',
'^',
'&',
'*',
'(',
')'};
161 const uint8_t KeyboardReportParser::symKeysUp[12] PROGMEM = {
'_',
'+',
'{',
'}',
'|',
'~',
':',
'"',
'~',
'<',
'>',
'?'};
162 const uint8_t KeyboardReportParser::symKeysLo[12] PROGMEM = {
'-',
'=',
'[',
']',
'\\',
' ',
';',
'\'',
'`',
',',
'.',
'/'};
163 const uint8_t KeyboardReportParser::padKeys[5] PROGMEM = {
'/',
'*',
'-',
'+',
'\r'};
166 uint8_t shift = (mod & 0x22);
173 return (key - 4 +
'A');
177 return (key - 4 +
'a');
187 return (key - 0x59 +
'1');