Closed Sydiepus closed 1 year ago
This change seems fine to me. Is there any way that we can wrap this in some Python API for qtile to be able to use it? That would definitely be preferred to just exposing it directly in the ffi object.
Like adding a method to the Keyboard class ?
notify_modifiers(mask)
and get_index
. I think the mask can be created with python and casted to the correct type later.
Or configure(mod_name)
method that does all the work.
Compositors now have to do something like this :
from wlroots.wlr_types.keyboard import ModifiersMask
mask = ModifiersMask(self.keyboard)
if numlock:
mask.add("Mod2")
if capslock:
mask.add("Lock")
self.keyboard.notify_modifiers(mask)
Maybe pass the keyboard to ModifiersMask
instead of the add
method ?
I was just about to start working on exposing this functionality to pywlroots in order to make it happen in qtile, this is awesome! Thank you, @Sydiepus.
(btw, I'm just random passerby, no affiliation with qtile or pywlroots)
Sway uses this function to configure the initial state of numlock/capslock.
Tested with Qtile.
Compositors would implement something similar to sway, like this to enable Numlock:
the Capslock is named
Lock
. My implementation is definitely not the best but it works.I'm not sure if there's a way to do the same thing using pywlroots instead of copying sway's implementation.