Reference

XGetKeyboardMapping(3) on Linux

The text 3415a7d0deda, as Debian 10 (Buster) shipped it.

manipulate keyboard encoding and keyboard encoding structure

XGetKeyboardMapping(3) on Linux now