-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
feat: Add options to set initial state for caps lock and num lock #4831
base: master
Are you sure you want to change the base?
Conversation
Tested the CI on my fork |
"""Set the initial num/caps lock state of the keyboard.""" | ||
mask = ModifiersMask(self.keyboard) | ||
if numlock: | ||
mask.add("Mod2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it true that Mod2
is always numlock? At least on x11, you'd need to query the modmap to see which thing is numlock, and add that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, maybe if the keys where remapped it will be different.
I don't really understand how xkb work but there's a modifier named NumLock
does it guarantee that it's always numlock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it'll work if you put NumLock
in there, but I honestly don't know. I think you probably have to do a xkb GetMap request to really get this to work right, which will require some changes in xcffib.
To be complete we should also call wlr_keyboard_led_update. But it's not exposed in pywlroots (yet) |
the pywlroots implementation of |
Oh I assumed it was needed because sway did it |
libqtile/resources/default_config.py
Outdated
@@ -25,6 +25,7 @@ | |||
# SOFTWARE. | |||
|
|||
from libqtile import bar, layout, qtile, widget | |||
from libqtile.backend.wayland.inputs import InputConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would fail if the Wayland dependencies are not present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could include these lines in the default config but comment them out. You can also add some comments to explain what they're for.
@jwijenbergh may have a different idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also do the import in an if backend is Wayland block. But at this point it's better to just make NumLock the default and have a false version commented?
This adds the ability set an initial state for caps lock and num lock using kb_capslock and kb_numlock InputConfig options. Closes: qtile#4225
c94664f
to
6ae925f
Compare
I was finally able to resolve the issues I was having and I was able to test the changes. |
This adds the ability set an initial state for
caps lock and num lock using kb_capslock and
kb_numlock InputConfig options.
Closes:
#4225