CAps LOck behaviour (Wayland)

Hey all, you guys must be familiar with this “issue”, I mean, some people use the caps lock to capitalize the first letter of a word, mostly the ones coming from Windows, but in Manjaro we have this so called “delay”, which causes this effect “CAps LOck” when typing something really quick, though I know there is a workaround for XORG users, I can’t find anything for Wayland users. Any ideas?

Shift button

:wink:

There is? :thinking:

1 Like

I’ve really tried to get used to using Shift, but I just can’t, it slows down my typing, that’s why I wish there was a way to change the caps lock behavior.

Answering your question, there’s a post here on the forum, which the title is: Incorrect CAPS LOCK key behavior? [Rant/Tutorial]. The solution in the post works on Xorg, but not in Wayland.

Gnome-tweak-tool - Keyboard and Mouse - Additional Layout Options - Caps Lock Behaviour just make it behave like shift?

2 Likes

Sadly, it doesn’t work

https://wiki.archlinux.org/title/Xorg/Keyboard_configuration#Switching_state_immediately_when_Caps_Lock_is_pressed

Hi,

I have make a bug report about this in wayland repo issue 232

Hello, everyone! I’ve finally found the solution, here’s how it goes:

Since the fastest way to change a key behavior on Wayland were through “Additional Layout Options”, I’ve changed one of the options for Caps Lock behavior, the one I chose was “make Caps Lock an additional Ctrl”. All you have to do is, go to “usr/share/X11/xkb/symbols/” and edit the file “capslock” (make a backup before this), then find the behavior called “ctrl_modifier”, it should look like this:

// This changes the <CAPS> key to become a Control modifier,
// but it will still produce the Caps_Lock keysym.
hidden partial modifier_keys
xkb_symbols "ctrl_modifier" {
    replace key <CAPS> {
        type[Group1] = "ONE_LEVEL",
        symbols[Group1] = [ Caps_Lock ],
        actions[Group1] = [ SetMods(modifiers=Control) ]
    };
    modifier_map Control { <CAPS> };
};

now replace it with this:

// This changes the <CAPS> key to become a Control modifier,
// but it will still produce the Caps_Lock keysym.
hidden partial modifier_keys
xkb_symbols "ctrl_modifier" {
		  key <CAPS> {
		      type="ALPHABETIC",
		      repeat=No,
		      symbols[Group1]= [ Caps_Lock, Caps_Lock ],
		      actions[Group1]= [ LockMods(modifiers=Lock),
		                         LockMods(modifiers=Shift+Lock,affect=unlock) ]
		  };
};

Save it and then go to “Gnome Tweaks” and activate the option “make Caps Lock an additional Ctrl” on “Additional Layout Options - Caps Lock behavior”.

Now your caps lock should be working with no delay! :wink:

P.S: I’ve tried to add a rule instead of replacing one, but it didn’t work, you could try if you don’t want to change anything.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.