On Sat, Dec 21, 2013 at 10:30 AM, Rich Shepard <[email protected]>wrote:

> # Exchange the left Control key and the Caps Lock key on the keyboard
> keymaps 0-2,4-6,8-9,12
> keycode 58 = Control
> keycode 29 = Caps_Lock
>

What if you change the keymaps line to the following?:
keymaps 0-255

...or whatever is returned by `dumpkeys | head -1`


If that doesn't work, try dumping the full keyboard translation table,
swapping the 29 and 58 keycodes and then reloading the entire table (as
root):
$> dumpkeys | perl -pe '%r=(29=>58,58=>29);s/ (29|58) / $r{$1} /g' >
~/.keymap-test
# manually double-check the keycodes were actually swapped
$> loadkeys ~/.keymap-test # you may need to add '-s' to clear the existing
table

If you need to reload the default keymap at any point:
$> loadkeys -d


   On the Dell laptop, when logged in as a user, root can run .keymap

successfully. This suggests that something needs user permissions (or user

ownership), but I've no idea what that is.
>

loadkeys needs to be run as root, as it affects all consoles.  From the
loadkeys man page:

WARNING

Note  that  anyone having read access to /dev/console can run loadkeys and
> thus change the keyboard layout, possibly making it unusable. Note that the
> keyboard translation table is common for all the virtual consoles, so any
> changes to the keyboard bindings affect all the virtual consoles
> simultaneously.
>
> Note  that because the changes affect all the virtual consoles, they also
> outlive your session. This means that even at the login prompt the key
> bindings may not be what the user expects.
>

Based on bug reports, this behaviour looks like it changed for most distros
around 2005-2006:
https://bugzilla.redhat.com/show_bug.cgi?id=174850
https://bugs.archlinux.org/task/3827


If you need to run loadkeys from a user script instead of in an
/etc/rc.local (or equivalent script), some people have had success in
creating a loadkeys group and using suid:
http://unix.stackexchange.com/questions/85374/loadkeys-gives-permission-denied-for-normal-user

Although, if you have sudo configured, the following might be cleaner but
not any more secure (unless you hard-code the path to the keymap file):
# /etc/sudoers
%wheel ALL=NOPASSWD: /usr/bin/loadkeys *

# ~/.bashrc
alias loadkeys='sudo /usr/bin/loadkeys'
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to