You are not logged in.
Pages: 1
Topic closed
I tried to use loadkeys to remap caps lock to Ctrl and Ctrl to caps lock but it doesn't work, because i think use caps lock is easier than press Ctrl when i move around keyboard. so i wonder:
1. how can i remap caps lock to Ctrl and Ctrl to caps lock in bash (in tty)
2. how can i remap caps lock to ESC in vim (in tty)
I tried to modify /usr/local/share/kbd/keymaps/personal.map
keycode 58 = 29
keycode 29 = 58
58 is caps lock keycode
29 is control keycode.
Thanks in advanced!
Offline
Assuming you are using systemd, you should create your custom keymap and link to it from /etc/vconsole.conf, like so:
KEYMAP=/etc/ctrl2escape.kmap
That will be sufficient to remap in your TTY (in Vim and any other apps you run)...
Offline
ctrl2escap is similar with my personal.map?. Can you show me in detail, in my special case? what i need to write in ctrl2escap?
Last edited by angelfalls (2012-10-28 05:42:02)
Offline
No. There is a wiki article that you can read:
https://wiki.archlinux.org/index.php/KEYMAP
Offline
That's work, but i mean when i in bash (console) i can use caps lock as left Ctrl so i remap, ok it's work, but when i in vim i want caps lock as Escape, anyway to make this behavior possibly?
Offline
You are not being very clear: I assume you mean vim in X? As opposed to vim in TTY - because a keymap will work for all apps in the TTY. For applications in X, you want to use setxkbmap.
Offline
Make two keymaps, write a super short script that simply changes keymap before calling vim.
I think you are not a native speaker, so don't take this the wrong way, but then you way "That's work..." a native speaker might actually parse that as "That is work I don't want to do..." What I think you actually mean though is "That works..." I surely hope I am correct on this.
Offline
yep, tks a lot, english is not my native language.
write a super short script that simply changes keymap before calling vim.
you mean i need to reload keymap when i call vim. if that i need to modify my .vimrc to call a script to reload the keymap. humm, that's problem, how can i call a script in .vimrc? i am new to linux so can you show me howto?
Offline
Hi! This is not a necro-bump, it just is a good thread to post.
I have a problem - I swapped the keycodes and checked it works with showkey. But now when I press CapsLock - it acts like Control but it also locks.
Meaning that I press and release the key and my keyboard acts like Control is still pressed (like CapsLock would normally act). I try to press it again, but it won't unlock Control to go back to normal behavior. It makes the keyboard unusable.
Any tips?
Offline
Yes, it is a necrobump. Also your issue is entirely different.
Closing
Offline
Pages: 1
Topic closed