Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to swap caps lock and ctrl without xorg?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
davidshen84
Apprentice
Apprentice


Joined: 09 Aug 2008
Posts: 266

PostPosted: Sun Jun 11, 2017 1:09 pm    Post subject: How to swap caps lock and ctrl without xorg? Reply with quote

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
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 22171
Location: here

PostPosted: Sun Jun 11, 2017 1:15 pm    Post subject: Reply with quote

Can help this and this?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
davidshen84
Apprentice
Apprentice


Joined: 09 Aug 2008
Posts: 266

PostPosted: Mon Jun 12, 2017 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 22171
Location: here

PostPosted: Mon Jun 12, 2017 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message
davidshen84
Apprentice
Apprentice


Joined: 09 Aug 2008
Posts: 266

PostPosted: Mon Jun 12, 2017 11:15 am    Post subject: Reply with quote

Thanks, I will try it out.
_________________
David Shen
Back to top
View user's profile Send private message
davidshen84
Apprentice
Apprentice


Joined: 09 Aug 2008
Posts: 266

PostPosted: Tue Jun 13, 2017 3:02 am    Post subject: Reply with quote

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
View user's profile Send private message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 255

PostPosted: Tue Jun 13, 2017 6:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2562

PostPosted: Tue Jun 13, 2017 7:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum