Excerpts from Dan S's message of Sat Mar 06 11:28:37 -0700 2010: > > I'm using xmodmap to remap caps-lock as f6 (since that executes a line > in scvim), working nicely in x-session windows. > > But in the virtual console, x stuff doesn't apply. Anyone know how I > can do the same thing there? >
Danger: you can really mess up your console keymaps this way. Also it will affect all the vtys at once. So best work out any problems on some system you can afford to maybe even power cycle if you can't get to reboot any normal way (unlikely). Sorry, not sure how to set it up to be done automatically at boot. Nor have I had a chance to try it on a p:d machine yet, but works on ubuntu karmic and all my other boxen, although on some computers LED display of capslock status stops working once caps lock has been removed and put back onto the Caps_Lock key. See man loadkeys, dumpkeys, showkey for more details. 1) Change to a vty with C-A-F3 or whatever and login. 2) Unless running `sudo loadkeys -d' works for you without errors, save output of 'dumpkeys' to somewhere convenient. Let's put it right in /home/lintian/ % dumpkeys > ~/defkeymap.kmap So now to put keys back to normal at worst run % sudo loadkeys /home/lintian/defkeymap.kmap This is because to fix mangled console keymaps usually you use one of: sudo loadkeys -d sudo loadkeys defkeymap sudo loadkeys /path/to/defkeymap.map # or defkeymap.kmap But I didn't find with debuntu or anywhere in p:d filesystem.squashfs any default keymap file so better save our own. 3) Find out what keycodes we care about by running `showkey' and pressing Caps and maybe F6. (Here keycode 58 is Caps_Lock, and keycode 64 is F6) Knowing keycode for F6 is only useful really if you want to put extra modified behaviour onto the caps key in your custom .kmap file, like shift-F6, alt-F6, etc. (You can look in your defkeymap at the definitions for extra keycode 64 stuff.) Don't need this for simple Caps key as F6 with no modifiers as in current scvim. 4) Write up some keymap files to alter the mappings on caps lock and use loadkeys to activate them: % cat caps_lock-to-f6.kmap keycode 58 = nul keycode 58 = F6 % sudo loadkeys ./caps_lock-to-f6.kmap The nul removes the normal caps lock Lock behaviour. On my boxen to put it back would be: % cat caps_lock-to-default.kmap keycode 58 = nul keycode 58 = CtrlL_Lock % sudo loadkeys ./caps_lock-to-default.kmap If it's really nasty hopefully you can still type the stuff in 2) to get back to the default keymap and try a variation. Hope this works well, or at least gets you most of the way there. Good luck! and thanks to all the sc scvim and p:d workers out there making my linux musical life a lot easier and more interesting. -- wmw --- Puredyne@goto10.org http://identi.ca/group/puredyne irc://irc.goto10.org/puredyne