You are not logged in.

#1 2020-11-08 09:26:10

Vir
Member
Registered: 2020-11-08
Posts: 4

[SOLVED] Problem with remapping Caps Lock using xkb

Hi! My keyboard has a broken key (Q q), I'm trying to remap it to Caps Lock. I'm using rukbi keyboard layout with typographic characters (https://aur.archlinux.org/packages/rukbi/).

I opened file 'rukbi_en' in /usr/share/X11/xkb/symbols and tried to add a line

key <CAPS> {[q, Q]};

saved the file, then I executed:

setxkbmap rukbi_en

but Caps Lock still works as Caps Lock. I tried to change other lines just to make sure I was editing the proper file and the following change worked:

key <AD02> {[d, D]};

So key W w now makes D d. But the trick still does not work with Caps Lock. Also I tried xmodmap, but result was even worse. What should I do for the proper remapping?

Last edited by Vir (2020-11-08 15:30:24)

Offline

#2 2020-11-08 11:09:05

andym
Member
From: France
Registered: 2019-01-16
Posts: 61

Re: [SOLVED] Problem with remapping Caps Lock using xkb

I think the problem is trying to use a modifier key - CapsLock. You could try it with the Windows key, it might work. Otherwise I would suggest using a punctuation key that you don't really need.

Offline

#3 2020-11-08 11:45:59

Vir
Member
Registered: 2020-11-08
Posts: 4

Re: [SOLVED] Problem with remapping Caps Lock using xkb

It's weird because I've already tried this method with other distro on the same laptop (Parrot OS) and it worked with Caps Lock.

Offline

#4 2020-11-08 14:15:53

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,325

Re: [SOLVED] Problem with remapping Caps Lock using xkb

It's possible to remap caps this way.

Please post the file you created as well as the output of "setxkbmap -print -query"

Offline

#5 2020-11-08 15:28:04

Vir
Member
Registered: 2020-11-08
Posts: 4

Re: [SOLVED] Problem with remapping Caps Lock using xkb

Thanks, seth! I tried

setxkbmap -print -query

and got the following:

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+rukbi_en+inet(evdev)+group(shift_caps_toggle)+group(alt_space_toggle)+group(ctrl_shift_toggle)"	};
	xkb_geometry  { include "pc(pc105)"	};
};
rules:      evdev
model:      pc105
layout:     rukbi_en
options:    grp:alt_space_toggle,grp:shift_caps_toggle,grp:ctrl_shift_toggle

I noticed option 'grp:shift_caps_toggle', deleted it and everything now works just perfect! Thank you!

Offline

#6 2021-07-25 18:36:05

Aetnaeus
Member
Registered: 2021-07-25
Posts: 7

Re: [SOLVED] Problem with remapping Caps Lock using xkb

I know this is old, but consider using https://github.com/rvaiya/keyd. It is a system wide solution that should work everywhere.

Offline

#7 2021-07-25 19:32:38

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,325

Re: [SOLVED] Problem with remapping Caps Lock using xkb

Do you intend to now necrobump each and every long solved remotely keymap related thread to plug this tool?
In case: stop.
Consider and feel free to write a wiki article about it, but the forum isn't a billboard.

Offline

#8 2021-07-25 21:28:49

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: [SOLVED] Problem with remapping Caps Lock using xkb

Aetnaeus wrote:

I know this is old, but consider using https://github.com/rvaiya/keyd. It is a system wide solution that should work everywhere.

One more time, and we will ban your account.  It appears you signed up for the sole purpose of spamming the accounts with that project.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2021-07-27 00:55:52

Aetnaeus
Member
Registered: 2021-07-25
Posts: 7

Re: [SOLVED] Problem with remapping Caps Lock using xkb

seth wrote:

Do you intend to now necrobump each and every long solved remotely keymap related thread to plug this tool?
In case: stop.
Consider and feel free to write a wiki article about it, but the forum isn't a billboard.

Apologies. I am trying to seed interest by demonstrating its utility for various use cases. Since the author of this post expressed interest in precisely what the tool was intended for I thought it was relevant enough to warrant posting.

Offline

#10 2021-07-27 00:56:48

Aetnaeus
Member
Registered: 2021-07-25
Posts: 7

Re: [SOLVED] Problem with remapping Caps Lock using xkb

ewaller wrote:
Aetnaeus wrote:

I know this is old, but consider using https://github.com/rvaiya/keyd. It is a system wide solution that should work everywhere.

One more time, and we will ban your account.  It appears you signed up for the sole purpose of spamming the accounts with that project.


Noted. For what it is worth I have been a member of the arch community for more than a decade and have a different account. Spamming the forum wasn't my intention.

Offline

#11 2021-07-27 01:01:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: [SOLVED] Problem with remapping Caps Lock using xkb

Aetnaeus wrote:

Spamming the forum wasn't my intention.

Fair enough.  Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB