X.A.Repeatable: Auto-detect modifier keys from currentEvent - #892
Conversation
This makes all the cycleSomething key bindings easier to use: users don't need to manually list the KeySyms of modifier keys in addition to specifying the mask for the keybinding itself. We can easily get those KeySyms from the KeyEvent currently being handled with the help of XGetModifierMapping.
|
Anyone happens to have an opinion about the API? |
|
This sounds much better than the current situation, but I guess breaking user configs by dropping an argument is always a bit "eh" :/ |
|
New API and mark the old one as deprecated? Or just go with "empty list means get it from the event"? |
X.A.Repeatable is used in X.A.CycleWindows, and also in X.A.{CycleWorkspaceByScreen,CycleRecentWS,MostRecentlyUsed} so changing the API would result in quite a lot of breaking changes, or at least quite a lot of new function names and lot of deprecations. I guess going with the "empty list …" option is better then. Or something. |
|
Re API, the functions in |
Yeah, agreed that changing the API of the That still leaves the question of what to do with all the client contrib modules, all of which have the same But I guess there's little point of further bikeshedding and I should just finish the doc updates and add a CHANGES entry… :-) |
|
@liskin Those modules / their maintainers should ultimately decide how to handle the change on a case by case basis, but in the meantime I would just have them ignore the It's not clear to me that there's any reason to make auto-detection optional. |
Description
This makes all the cycleSomething key bindings easier to use: users don't need to manually list the KeySyms of modifier keys in addition to specifying the mask for the keybinding itself. We can easily get those KeySyms from the KeyEvent currently being handled with the help of XGetModifierMapping.
This only implements the logic in
X.A.Repeatable. We need to decidewhether to change the API of all the user-facing functions (drop the
modsargument), just document that empty list means "auto-detect", or some
combination thereof.
Checklist
I've read CONTRIBUTING.md
I've considered how to best test these changes (property, unit,
manually, ...) and concluded:
seems to work fine for me…
automated testing not feasible
I updated the
CHANGES.mdfile