In Konsole (KDE) I once "hacked" an encoding. Not really. Maybe I did it the wrong way, but it worked for me
The situation, somewhat over simplified
The server sends forms with mixed language (what would count as first level and third level on a modern system), but uses plain upper case and lower case text to encode it (so for example A=A and a=À). And it also expects text to be typed the same way, but not exactly. Originally the system used some Windows 95 machines with custom built telnet client specially for this encoding, that took care of everything. Then I set up some more boxes running Linux to the network
What I did
Part 1 : Make copy of a layout file from /usr/share/X11/xkb/symbols/. Rename it indise and outside to a new locale name (for example "forms") or add a variant to an existing locale (anyway backup the file as you're going to screw it multiple times when experimenting). The file is a table matching characters to keyboard keys. Edit it and set what character you want each key to type in your application. Save and add this new layout to your keyboard layouts, so you can switch to it
Part 2 : Make copy of a font. Rename it inside and outside to a new name, change the "font family name" too. Open it with Fontforge, copy the characters you want to the new places (for example, copy À to a), save and install. Configure Konsole to use this font
Part 3 : Instruct the user to switch to "the forms language" when using this application. Any key he types is changed to the correct code by the xkb file, and that's how it's submitted to the server. Any key appearing on the screen appeaars in the font you created, and the shape of the character is what you want the user to see
|