You are not logged in.
Hey everyone,
I've read on various places how to switch the Caps-Lock and Escape keys (for use with Vim, mainly), but I'm having quite some trouble accomplishing this. I have created a .Xmodmap file in my home folder, and have placed in there the commands needed to switch the two keys, more specifically, the following (from the Vim tips wiki, I have tried several of them, with the same outcome):
keycode 66 = Caps_Lock
keycode 9 = Escape
remove Lock = Caps_Lock
add Lock = Escape
keycode 9 = Caps_Lock
keycode 66 = Escape
The thing is, if I invoke xmodmap normally in a terminal, everything works fine, but when invoked in some X startup script, it behaves unexpectedly. It basically associates Caps_Lock to Esc and Esc to Caps_Lock, but doesn't remove the Caps_Lock functionality from it. I'm using cdm as my dm and Openbox as my wm, I have tried to invoke xmodmap from /usr/share/cdm/xinitrc, adjusted cdm's configuration and tried my user's .xinitrc and .config/openbox/autostart, with no success in either of them. If I place it in .bashrc, it runs when I start a terminal, and works correctly...
Any help would be appreciated,
Cheers
Last edited by Blackened Justice (2012-05-21 23:22:48)
Offline
I don't bother with xmodmap, I just put this is .xinitrc
setxkbmap -option caps:escape
Offline
Well, that works. I tried it with -option caps:swapescape, and now it's perfect! Thank you very much!
But still, any particular reason why it wasn't working correctly with xmodmap?
Cheers
EDIT: Also, on an unrelated matter: How can I set a non-blinking block cursor on a non-X terminal (Ctrl+Alt+F1, etc.)?
Last edited by Blackened Justice (2012-05-21 21:10:16)
Offline
EDIT: Also, on an unrelated matter: How can I set a non-blinking block cursor on a non-X terminal (Ctrl+Alt+F1, etc.)?
Old, but so is the console: http://linuxgazette.net/137/anonymous.html
Offline
$ cat ~/.Xmodmap
remove Lock = Caps_Lock
add Lock = Escape
keysym Caps_Lock = Escape
keysym Escape = Caps_Lock
+
xmodmap ~/.Xmodmap
in .xinitrc seems to work here.
Offline
$ cat ~/.Xmodmap remove Lock = Caps_Lock add Lock = Escape keysym Caps_Lock = Escape keysym Escape = Caps_Lock
+
xmodmap ~/.Xmodmap
in .xinitrc seems to work here.
I tried that, too, but it worked as described in the OP. Anyway, I'm happy with setxkbmap And thank you again, jasonwryan, that article was helpful
Cheers
Offline
Cool. Please remember to mark your thread as [Solved].
Offline
I've tried the cursor trick too, but
https://bbs.archlinux.org/viewtopic.php?id=97952
basically, all you have to do is use an escape sequence. but if you insert it only in your .whatevershellrc, the blinking cursor will return after opening a programme, e.g. nano. so you have to follow the instructions on the emacswiki page.
http://www.emacswiki.org/emacs/CursorOnLinuxConsole
(I haven't tried it, I don't use console all that much these days)
Offline