X Keyboard Configuration Database
The goal is to provide the consistent, well-structured, frequently released open source of X keyboard configuration data for X Window System implementations (free, open source and commercial). The project is targeted to XKB-based systems.
https://people.uleth.ca/~daniel.odonnell/Blog/custom-keyboard-in-linuxx11 looks useful as well.