A comprehensive list of working scancodes?


#1

I’ve recently been seriously thinking about creating a custom X keyboard layout designed to accompany a modified layout on my Model 01.

I’m planning for a large number of typable glyphs in multiple linguistic scripts and this keyboard is pretty much dedicated exclusively to this one computer, so I figure it’s probably going to be a better choice to put as much of the heavy lifting into the computer with more memory and CPU (i.e. the computer).

At the same time, the Model01 is able to be much more flexible than a standard USB keyboard and generate a larger range of unique keypress events than other keyboards, providing opportunities for simplification and/or increased flexibility in the OS-side keymap.

Along the way I started thinking that I don’t really know what the full expressive range of the Model01 is over USB, which I know will then be filtered through my kernel and device drivers and (most of the time) then passed on to X. At every step of the way there are mappings made and the possibility for some codes to be merged with other codes or dropped completely.

Has anyone attempted comprehensive documentation of:

  • what the Keyboardio Model01 can produce in a report (the documentation I’ve seen hints that there are limitations that may be imposed by the Arduino infrastructure)
  • what the OS will receive (though maybe this could be influenced by presenting additional devices to the host OS, somewhat like what was done for the two mouse devices?) - knowing that this will be OS dependent.
  • what is then made available for use in a keyboard layout (under Linux this would be X, under MacOS it would be something else, and under Windows it may be identical to the previous data set.

If not, does anyone have any suggestions for how one might go about producing this data with minimal chances for human error?


(Gergely Nagy) #2

The closest to this are the USB HID descriptors for BootKeyboard and NKROKeyboard.

What the HID descriptor describes, is what we can technically send.

Sadly, I have no good answer for your other questions. In case of Linux, I know of no way to figure out how the kernel interprets a given scancode, in a reliable way, let alone how that gets through to X…