Creating Custom Keymaps for Exotic Keys


I am working on setting up my sway config on a new device which has some exotic keys and key combinations. For example, I have completely separate mute and volume keys. I would like to configure these keys to do the appropriate functions. I know I can do this by editing the default sway config file, however I am unsure how to call out these keys by “name.”

I know I can use sudo showkey to get the keycode (for example 230), followed by grep -r -e 'key.*230.*>' /usr/share/X11/xkb/ which will sometimes return a line like /usr/share/X11/xkb/symbols/inet:// key <I230> { [ ] }; // KEY_ALTERASE which has the keycode listed but does not “name” it. Other times (such as with keycode 114) the grep command returns nothing which leads me to suspect it is not even defined.

How do I go about adding/defining these keys? Do I somehow edit one or more of the files in the /usr/share/X11/xkb/ directory or is there something completely different I should be doing?