Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keyboard: Don't skip NONUS_POUND and CLEAR
To be able to send NONUS_POUND and CLEAR keycodes, we need our report bitmap to support them, and not mask them over with constants. These were originally masked due to bugs in the Linux kernel: it treats NONUS_POUND the same as BACKSLASH, and CLEAR the same as DELETE. There is no way for userland to distinguish the two under Linux. But this is a linux-specific issue, one that is not relevant when neither NONUS_POUND or CLEAR appear on the keymap. Linux will happily accept a descriptor that does not mask this out (even ancient versions, going back 13 years). It will not double-press if these appear in the report. At worst, repeat will kick in faster if both BACKSLASH and NONUS_POUND are held at the same time. However, other OSes may - and do - work differently, and some of them handle NONUS_POUND separately from BACKSLASH. Because not masking out these keys in the report causes no issues under Linux (the only reason for the mask) unless the keys are in the report, and even then, the issue is not critical, we should not punish other operating systems. Linux has had this issue for at least 13 years (7 for CLEAR/DELETE). Changing it would require changes to the kernel and a whole lot of userland too. I do not see that happening in my lifetime, and that's even more reason for not waiting for Linux to get rid of the bug before changing the descriptors. Therefore, this patch removes the mask, and only the first four bits remain masked. Therefore, operating systems that can treat NONUS_POUND and CLEAR separately from BACKSLASH and DELETE will be able to do that, and Linux will not be severely impacted either. And we also save a few bytes. Fixes #273. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
- Loading branch information