Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CapsLock change upon press instead of release option. #372

Open
siriuslee69 opened this issue Sep 3, 2023 · 7 comments
Open

CapsLock change upon press instead of release option. #372

siriuslee69 opened this issue Sep 3, 2023 · 7 comments
Labels
enhancement Indicates new feature requests meta The scope is too wide to be treated here needs info

Comments

@siriuslee69
Copy link

siriuslee69 commented Sep 3, 2023

Hey, could we add an option to change the CapsLock button to release on button press instead of button release?

The current behaviour leads to accidental uppercase letters after trying to switch from upper to lower case when writing fast:

"THe elephant was very thirsty. UNfortunately there was no water around."

Currently there are a couple of scripts out there that fix this by setting CapsLock as a Ctrl Modifier and some other stuff (as seen below), but afaik this does not work for NixOS at the moment. At least not by changing the configuration.nix (or maybe I'm too dumb, but then so are probably 90% of the other casual Windows users). I already went to the NixOS discord and they could only point me towards xkb.
As Linux grows in popularity more, I assume more people will start switching from Windows to Linux and encounter this problem. This inconvenience has been around for forever, there are threads that are like 10 years old.
I think an official option to change this would be greatly appreciated instead of using weird system hacks and automated scripts.

This is the script that would supposedly fix this on arch/ubuntu btw:


// 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) ]
    };
};

Taken from https://github.com/rafaeloledo/linux-capslock-delay-fix .

Thanks in advance. Oh and before anyone starts the usual discussion about just switching to Shift:

"Sean Wrona, one of the world's fastest typists, uses Caps Lock for capital letters. He often types at 250+ wpm.
From his website:
'I recommend using caps lock instead of shift to type capital letters to allow more flexibility in the hand that you would normally use shift with.' "

@wismill
Copy link
Member

wismill commented Sep 12, 2023

Thank you for your report. Since you already have a solution and that solution only involves modifying the XKB files, I suggest you report to xkeyboard-config project.

Now, if you want this feature backed into xkbcommon, there are some points you need to take into account:

  • Better justification: how many people use this feature? There has been no demand for this feature until now.

    Oh and before anyone starts the usual discussion about just switching to Shift […]

    Ergonomy is more important for me than speed. I find it a terrible idea to use CapsLock this way. You need to press it 2 times instead of one time for shift. I think what you are really looking for is “latched modifier”, which is already supported.

  • Such a change would require a change in the text format, which would require to update the corresponding Wayland protocol.

  • In case xkbcommon devs have no interest or no resources for this, it will be up to you to propose a PR.

@wismill wismill added enhancement Indicates new feature requests meta The scope is too wide to be treated here labels Sep 12, 2023
@bluetech
Copy link
Member

This is the 20 years old "need to kick hotkeys" issue https://gitlab.freedesktop.org/xorg/xserver/-/issues/258. Maybe @wismill has the fortitude to tackle it :)

@wismill
Copy link
Member

wismill commented Sep 25, 2023

@bluetech Thanks for the reference! That’s quite a long discussion. I won’t deal with it any time soon.

@siriuslee69 could you answer my question above? If you feel motivated could you also consult the issue in xserver and maybe sum it up here: it might give more weight to your feature request.

@siriuslee69
Copy link
Author

@wismill

Hey, sorry for the late reply. And thank you, by the way, for the fast response and followup. I'm not actively using github, so I kinda lost track of this.
I am still trying to figure out how or where this feature would best be implemented. But to know this requires me to understand what xkb and the config does and how the fix works. I'll read through the mentioned issue tomorrow or the day after and see if this is part of the problem I am facing.

Since you already have a solution and that solution only involves modifying the XKB files, I suggest you report to xkeyboard-config project.

I didn't know of this, so thank you for pointing me in this direction. I'm still not entirely sure whether setting capslock as a "ctrl-modifier" is a workaround or if it is intended to be used that way (whatever a ctrl_modifier does/is, idk).
Also, I vaguely remember that there might've been some issues with the provided fix-script, where active capslock would block the use of Alt Gr or something similar. If so, the solution won't be as straightforward.

Better justification: how many people use this feature?

Well, I think it's more of a question of "How many people would use this feature and would've stayed on linux, if this was the default behavior, like it is on Windows as well?"
I mean, it is really frustrating when such a basic interaction like typing becomes tedious and forces me to rethink what I usually do without thinking at all.
Also, from what I heard, I'd assume mainly older people use capslock for writing, because they're used to using typewriters. (I'm not that old though, lol.) So, of course, in this group (of capslock users) that mainly consists of old people, I'd say the chances are lower than usual for someone to come here and try to open an issue.
Of course I don't have any statistics on that, but in general I'd assume that users that come from Windows would want Linux (at least at the basic level) to feel as responsive as Windows.

But, as you said, the issue might be better dealt with in the config repo. I'll have to look through the docs first.

Is it of importance that issues get closed fast / does it matter if I take my time figuring things out?
Thank you for your patience!

@wismill
Copy link
Member

wismill commented Sep 26, 2023

Is it of importance that issues get closed fast / does it matter if I take my time figuring things out?

@siriuslee69 As you can see in the list of issues of this repo, there are some quite old. So what is important is the relevancy of the issue for this project and if the author provide sufficiently info to us in order to process the issue.

@wismill
Copy link
Member

wismill commented Sep 28, 2023

This issue is not trivial at all and has a lot of history. For context: see #92. I will not tackle this anytime soon.

@wismill
Copy link
Member

wismill commented Jan 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests meta The scope is too wide to be treated here needs info
Projects
None yet
Development

No branches or pull requests

3 participants