View previous topic :: View next topic |
Author |
Message |
davidshen84 Guru
Joined: 09 Aug 2008 Posts: 314
|
Posted: Sun Jun 11, 2017 1:09 pm Post subject: How to swap caps lock and ctrl without xorg? |
|
|
Hi,
I would like to swap the caps lock key and the left ctrl key, as I am a Emacs user. I found several tips on how to do it with X. But I would like to do it even before X stars, so I could use this feature under terminal.
My system is Gentoo 64 bit, with systemd. Any idea how can I achieve that?
Thanks. _________________ David Shen |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30909 Location: here
|
Posted: Sun Jun 11, 2017 1:15 pm Post subject: |
|
|
Can help this and this? _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
davidshen84 Guru
Joined: 09 Aug 2008 Posts: 314
|
Posted: Mon Jun 12, 2017 12:41 am Post subject: |
|
|
I think the 1st one is talking about terminal under X; and the 2nd is for OpenRC, but I have systemd. I guess there's similar method under systemd, I just have not found it online... _________________ David Shen |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30909 Location: here
|
Posted: Mon Jun 12, 2017 5:38 am Post subject: |
|
|
davidshen84 wrote: | I think the 1st one is talking about terminal under X; |
No virtual console are not X terminal
www.emacswiki.org wrote: | Virtual consoles
This is not the same as a terminal running in a window under X! It is the text-only mode typically accessed by pressing Ctrl+Alt+F1-F6. |
davidshen84 wrote: | and the 2nd is for OpenRC, but I have systemd. I guess there's similar method under systemd, I just have not found it online... |
Yes, my fault, but with a simple search in wiki.gentoo.org you can find this (anyway I'm not sure you can set emacs as KEYMAP) _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
davidshen84 Guru
Joined: 09 Aug 2008 Posts: 314
|
Posted: Mon Jun 12, 2017 11:15 am Post subject: |
|
|
Thanks, I will try it out. _________________ David Shen |
|
Back to top |
|
|
davidshen84 Guru
Joined: 09 Aug 2008 Posts: 314
|
Posted: Tue Jun 13, 2017 3:02 am Post subject: |
|
|
I tried to set the keymaps from systemd, and it did changed the caps lock key to function as a ctrl key. However, what I am looking for is to swap the caps lock key and the ctrl key. That is to say, I need the left ctrl key to function as a caps lock key.
I guess I can go deeper and modify the key maps file in the system. But I just have no idea where to look for those files... _________________ David Shen |
|
Back to top |
|
|
R0b0t1 Apprentice
Joined: 05 Jun 2008 Posts: 264
|
Posted: Tue Jun 13, 2017 6:40 pm Post subject: |
|
|
Editing the layout you use in "/usr/share/kbd/keymaps/" will change the layout for all users. Alternatively you can look at using a program called loadkeys - you may wish to decompress your keymap from the default directory as a starting point, or you may use dumpkeys.
The lines are given as "keycode # = Symbol". Simply switch the place of capslock and left control.
See https://wiki.archlinux.org/index.php/Keyboard_configuration_in_console or search "virtual terminal keyboard layout" or some variation thereof. |
|
Back to top |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Tue Jun 13, 2017 7:25 pm Post subject: |
|
|
Editing the layout as @R0b0t1 said will also erase your change every time you get an update to the appropriate package.
You should be able to store the file elsewhere and get the same results. |
|
Back to top |
|
|
|