It's not completely clear if you are on a client or on the server so let me try to distinguish.
If you ssh from another machine then input from keystrokes are handled by your SSH terminal application on the client machine, not by anything on the server.
So would be enough to change the keymap on client side like i.e. here.
If Ipad does not allow it I'm afraid you should use another remote terminal or relay on the application you use to remap the keys (if possible). here a quick how-to for vim, emacs has something similar.
For the rest of the answer I'll assume you are logged "on Ubuntu Snap server" not remotely.
There are 2 ways to achieve the same:
- through loadkeys (requires console-data to be installed)
dump the layout of your keyboard:
# dumpkeys >modified.kmap
Modify the layout as needed:
# in your case you should substitute in the modified.kmap
#a not elegant way would be to add at the end of the file:
keycode 1 = Caps_Lock
keycode 58 = Escape
Apply changes
# loadkeys ./modified.kmap
Check changes are in place:
# dumpkeys |grep "Escape"
[...]
keycode 58 = Escape
# dumpkeys |grep "Caps_Lock"
keycode 1 = Caps_Lock
- through a trick with
/etc/default/keyboard
Add the following to your layout in /etc/default/keyboard
XKBOPTIONS="caps:swapescape"
Reconfigure the keyboard through dpkg NB keeping the options (this has to be done also in case your layout is already the correct one)
# dpkg-reconfigure keyboard-configuration
answer yes when you are asked Keep current keyboard options in the configuration file?
Let me know if this was useful.
Do you want to have ESC and CAPS switch their functions?
Do you want the new modified-CAPS and ESC to essentially both remain operational and produce the same outcome as would have been produced by ESC?
Please provide us some more info, because writing the final script will be a breeze and will provide it promptly. but I cannot start writing one until I understand what your requirements are.
– NetIceGear Mar 05 '19 at 02:20CMD
+[
work forEscape
key as answer below recommends trying? – WinEunuuchs2Unix Mar 11 '19 at 09:44