Advertisement

Q(FBSD): Want to make caps lock into esc.

Started by August 19, 2003 07:25 AM
7 comments, last by Feral 21 years ago
Hi there I am trying to make it so that when I press caps lock it is exactly the same thing as pressing escape. Under Linux I believe this is via loadkeys. Under FreeBSD this would seem to be via `kbdcontrol -l` and a modified keymap file (thinking of basing off of `/usr/share/syscons/keymaps/us.pc-ctrl.kbd`), as I want to make backspace be backspace (and not delete which it currently is) this would seem like the best spot. A quick Google was not very helpfull though. Comments/suggestions welcome, of course Thank you, Feral
I have no idea how to do this, but since you said comments are welcome... Why exactly do you want to do this?

Just curious.

The Artist Formerly Known as CmndrM

http://chaos.webhop.org
Advertisement
(= Why is a good question really.

Mostly because of vim (esc gets hit alot), I have found that it is pretty handy outside of vim as well. An as I don''t use caps lock, I figure might as well make use of the key for something else
You could just ''kbdcontrol -d KeyboardMap.Current'', ''cp KeyboardMap.Current KeyboardMap.Origional'', make your changes to Current, then ''kbdcontrol -l KeyboardMap.Current''.

I''m not sure, but I think you have to run the kbdcontrol commands from your console, you can''t ssh or telnet into the server to do it. You can then specify what Keyboard map you want to use in /etc/rc.conf. I think you would have to add the line ''keymap=/path/to/your/KeyboardMap.Current''. This will change that key for all system users though.

I guess you could also set a kbdcontrol -f and set a function key number as well instead of mapping it to your capslock.

Int.
Ah that does sound like a better plan, thank you

It does look like it has to be console; term win in X no workie... soon as I can get out of here I''ll give it a try. ... Heh, I discovered a touch late that `portupgrade -rR python` results in a rather large dependancy download. Still, on the high side I think I''ve got most of gnome2 now, heh.
hm, I should remap my capslock to control, like it should be.
Advertisement
X has its own translation stuff. xmodmap or something like that I think?

I''ve never had to use it myself.
Once I figure this out I''ll have something usefull to post. (*sigh* It''s giving me fits)

The program is xmodmap btw, though I''m not sure if that is the one and only.
I am not sure (at all) if this is proper, but it does seem to work:

quote: ~/.xmodmaprc
remove lock = Caps_Lock
keysym Caps_Lock = Escape


quote: ~/.xinitrc
...
xmodmap ~/.xmodmaprc &
...
# start your WM of choice here.


I had a hell of a problem with this because I typoed xmodmap in ~/.xinitrc .. duh.

*edit some dork forgot to close his quote...*

[edited by - FeralofFireTop on August 29, 2003 11:36:43 PM]

This topic is closed to new replies.

Advertisement