Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had to create a modified keyboard layout, starting from one in /usr/share/kbd/keymaps.

Use the showkey command to find out what keycode the caps lock key generates (mine is 58), then add a line in your layout file to the effect of

keycode 58 = Escape Escape Escape Escape Escape

Finally, load your new layout using loadkeys /usr/share/kbd/keymaps/i386/{yourlayoutname}/{yourlayoutname}.map.gz




I finally tried this out today: (while TERM=linux) keys.kmap: keymaps 0-127 keycode 1 = CtrlL_Lock keycode 58 = Control

sudo loadkeys keys.kmap

This works, but I haven't set this up to load on startup yet.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: