Bug 462677

Summary: Ability to set caps lock behavior as enabled with shift.
Product: [Applications] systemsettings Reporter: jakubby
Component: kcm_keyboardAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: butirsky, jakubby
Priority: NOR    
Version First Reported In: 5.26.4   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Video file

Description jakubby 2022-12-05 16:18:09 UTC
SUMMARY
I've been able to set caps lock through a special menu as my switch keyboard layout key on arch linux.
This causes the behavior of caps lock hidden behind a shift+caps lock combination.
It would be great if it was possible to set this behavior in any other way than this menu where specific key combinations can be selected.

STEPS TO REPRODUCE
1. Install neon.
2. Add more than 2 layouts.
3. Set caps-lock as the switch key for keyboard layouts.
4. Switching layout now enables the caps lock functionality, but it didn't in the past or at least on arch linux.

OBSERVED RESULT
Switching a language now enables caps lock.

EXPECTED RESULT
Being able to set the caps lock behavior to only enable by combining it with a shift key.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon User Edition.
KDE Plasma Version:  5.26.4
KDE Frameworks Version:  5.100.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Wayland
Comment 1 jakubby 2022-12-05 16:18:40 UTC
As in:
shift+caps lock == normal caps lock behavior.
Comment 2 Andrey 2022-12-05 17:41:25 UTC
What layouts do you add?
You mean if you continuously press  a caps-lock now, it will stop switching layouts after the first switching and start acting as ordinary caps-lock?
Comment 3 jakubby 2022-12-05 17:43:28 UTC
(In reply to Andrey from comment #2)
> What layouts do you add?
> You mean if you continuously press  a caps-lock now, it will stop switching
> layouts after the first switching and start acting as ordinary caps-lock?

What I mean is before I was able to set it so caps-lock would only act as switching layouts around.
Now it does both, switching caps-lock and acting as a switch layout switch.
I was able to then click shift+caps lock to only swap the caps lock state.
Comment 4 jakubby 2022-12-05 17:43:50 UTC
Poland (default)
French (US)
Comment 5 Andrey 2022-12-05 18:48:23 UTC
(In reply to jakubby from comment #0)
> 3. Set caps-lock as the switch key for keyboard layouts.
Where do you set it?
Comment 6 Andrey 2022-12-05 19:02:37 UTC
(In reply to jakubby from comment #3)
> Now it does both, switching caps-lock and acting as a switch layout switch.
That's really odd, don't you have some IBus packages installed, just for the case?
I need someone to confirm that before I'll look it myself.
> I was able to then click shift+caps lock to only swap the caps lock state.
Does shift+caps work now?
Comment 7 jakubby 2022-12-05 19:20:14 UTC
(In reply to Andrey from comment #6)

There's an "Alternative shortcut" and "Main shortcut".
The main shortcut let's you select from a list of possibilities, and selecting caps lock there, makes the shift+caps lock to use caps lock(which is proper), and caps lock to switch layout.

While when you set the capsLock in the Alternative shortcut you don't pick from a list.

It's just that the functionality is proper with Main shortcut(planned functionality), and isn't with Alternative shortcut(free form user selection)
Comment 8 Andrey 2022-12-05 19:34:11 UTC
(In reply to jakubby from comment #0)
> 4. Switching layout now enables the caps lock functionality, but it didn't
> in the past or at least on arch linux.
I doubt it worked the other way, can you test on VM and say precisely where it worked?
If you set the key via "Alternative shortcut", there is nothing that could enable shift+caps behavior. Probably the option in Advanced tab was just already set there.
Comment 9 jakubby 2022-12-05 19:44:48 UTC
(In reply to Andrey from comment #8)
> (In reply to jakubby from comment #0)
> > 4. Switching layout now enables the caps lock functionality, but it didn't
> > in the past or at least on arch linux.
> I doubt it worked the other way, can you test on VM and say precisely where
> it worked?
> If you set the key via "Alternative shortcut", there is nothing that could
> enable shift+caps behavior. Probably the option in Advanced tab was just
> already set there.
The difference is that switching the "Main shortcut" lands me into Advanced tab and alternative rightfully so does not.
It just works okay, like we can remove this request, everything works as it should have.
Caps lock turns into switch layout key.
Caps lock + shift turns into caps lock, just like it should.

It really just works the way it should be working.
I just selected caps lock in the alternative shortcut on my machine, and thought the functionality is broken.
Comment 10 jakubby 2022-12-05 19:49:54 UTC
Created attachment 154345 [details]
Video file
Comment 11 Andrey 2022-12-05 20:18:39 UTC
Unfortunately I can't see the video uploaded.
Anyway, the way it works is for "Main shortcut" , the underlying XKB system does the switching so it cares that no overlapping occurs for the shortcut.
For  "Alternative shortcut", Plasma does the switching on top of what XKB does, and nothing prevents the overlapping shall it occurs.

In your case, Caps lock handled both by XKB (as usual Caps lock functionality) and Plasma (as layout switching). Thus the collision.

Probably we should have to placed a Tooltip on the "Alternative shortcut" option or whatever to warn the user about this.
You are welcome to open the issue.
I'll close this one.