Improve mouse button parsing: bar mouse bindings #3344
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE UNTIL AFTER #3341This is the fourth in a series of follow-up PRs for #3313.
This modifies
bar_cmd_bindsym
to useget_mouse_bindsym
for parsingmouse buttons. This also introduces
cmd_bar_bindcode
, which will useget_mouse_bindcode
for parsing mouse buttons. Like sway bindings, thetwo commands are encapsulated in a single file with shared code.
This also modifies swaybar to operate off of event codes rather than x11
button numbers, which allows for any mouse button to be used. Tray bindings
will be modified in a separate PR.
This introduces two new IPC properties:
get_bar_config
,event_code
has been added to thebindings
section and will include to event code for the button. If the event code
can be mapped to a x11 button,
input_code
will still be the x11 buttonnumber. Otherwise,
input_code
will be0
.click_events
,event
has been added and will includethe event code for the button clicked. If the event code can be mapped
to a x11 button,
button
will still be the x11 button number.Otherwise,
button
will be0
.