Modifying previous HID report during parsing of current HID report may lead to spurious PS/2 key presses: some HID devices report 2nd key in a combo by shifting the report to the right and saving that key in the 1st report slot, essentially overwriting the 1st key in prev_rpt. The 1st key in the 2nd slot will be reported once more, as it is missing from prev_rpt.
For example, if I hold T then press P on such a keyboard, it may produce the following HID reports:
00 00 17 00 00 00 00 00 // after first report
00 00 13 00 00 00 00 00 // after parsing 0x13 in second report
// when parsing 0x17 in second report, we could not find 0x17 in prev_rpt so another make code for P is sent
00 00 13 17 00 00 00 00 // after parsing 0x17 in second report
Modifying previous HID report during parsing of current HID report may lead to spurious PS/2 key presses: some HID devices report 2nd key in a combo by shifting the report to the right and saving that key in the 1st report slot, essentially overwriting the 1st key in prev_rpt. The 1st key in the 2nd slot will be reported once more, as it is missing from prev_rpt.
For example, if I hold T then press P on such a keyboard, it may produce the following HID reports:
And here is how
prev_rpt
changes: