Introduce named aliases for mouse buttons.

This increases readability and allows us to cover up the fact that
XCB doesn't define constants for left/right scrolling.
This commit is contained in:
Ingo Bürk
2017-02-12 20:36:42 +01:00
committed by Ingo Bürk
parent ad9c879cbd
commit 7732971ad8
3 changed files with 24 additions and 13 deletions

View File

@ -531,7 +531,7 @@ void handle_button(xcb_button_press_event_t *event) {
return;
}
switch (event->detail) {
case 4:
case XCB_BUTTON_SCROLL_UP:
/* Mouse wheel up. We select the previous ws, if any.
* If there is no more workspace, dont even send the workspace
* command, otherwise (with workspace auto_back_and_forth) wed end
@ -541,7 +541,7 @@ void handle_button(xcb_button_press_event_t *event) {
cur_ws = TAILQ_PREV(cur_ws, ws_head, tailq);
break;
case 5:
case XCB_BUTTON_SCROLL_DOWN:
/* Mouse wheel down. We select the next ws, if any.
* If there is no more workspace, dont even send the workspace
* command, otherwise (with workspace auto_back_and_forth) wed end