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];
55 for (uint8_t i = 2; i < 8; i++) {
59 for (uint8_t j = 2; j < 8; j++) {
60 if (buf[i] ==
prevState.bInfo[j] && buf[i] != 1)
72 for (uint8_t i = 0; i < 8; i++)
97 const uint8_t KeyboardReportParser::numKeys[] PROGMEM = {
'!',
'@',
'#',
'$',
'%',
'^',
'&',
'*',
'(',
')'};
98 const uint8_t KeyboardReportParser::symKeysUp[] PROGMEM = {
'_',
'+',
'{',
'}',
'|',
'~',
':',
'"',
'~',
'<',
'>',
'?'};
99 const uint8_t KeyboardReportParser::symKeysLo[] PROGMEM = {
'-',
'=',
'[',
']',
'\\',
' ',
';',
'\'',
'`',
',',
'.',
'/'};
100 const uint8_t KeyboardReportParser::padKeys[] PROGMEM = {
'/',
'*',
'-',
'+', 0x13};
103 uint8_t shift = (mod & 0x22);
106 if (key > 0x03 && key < 0x1e) {
110 return (key - 4 +
'A');
114 return (key - 4 +
'a');
116 else if (key > 0x1d && key < 0x27) {
118 return ((uint8_t)pgm_read_byte(&numKeys[key - 0x1e]));
120 return (key - 0x1e +
'1');
122 else if (key > 0x58 && key < 0x62) {
124 return (key - 0x59 +
'1');
125 }
else if (key > 0x2c && key < 0x39)
126 return ((shift) ? (uint8_t)pgm_read_byte(&symKeysUp[key - 0x2d]) : (uint8_t)pgm_read_byte(&symKeysLo[key - 0x2d]));
127 else if (key > 0x53 && key < 0x59)
128 return (uint8_t)pgm_read_byte(&padKeys[key - 0x54]);
133 case KEY_ZERO:
return ((shift) ?
')':
'0');