forked from external/yambar
config+particle: add support for mouse wheel up/down
This commit is contained in:
parent
c79ffbe057
commit
34d832cd22
4 changed files with 10 additions and 0 deletions
|
@ -164,6 +164,8 @@ conf_verify_on_click(keychain_t *chain, const struct yml_node *node)
|
|||
{"left", false, &conf_verify_string},
|
||||
{"middle", false, &conf_verify_string},
|
||||
{"right", false, &conf_verify_string},
|
||||
{"wheel-up", false, &conf_verify_string},
|
||||
{"wheel-down", false, &conf_verify_string},
|
||||
{NULL, false, NULL},
|
||||
};
|
||||
|
||||
|
|
4
config.c
4
config.c
|
@ -160,6 +160,10 @@ conf_to_particle(const struct yml_node *node, struct conf_inherit inherited)
|
|||
on_click_templates[MOUSE_BTN_MIDDLE] = template;
|
||||
else if (strcmp(key, "right") == 0)
|
||||
on_click_templates[MOUSE_BTN_RIGHT] = template;
|
||||
else if (strcmp(key, "wheel-up") == 0)
|
||||
on_click_templates[MOUSE_BTN_WHEEL_UP] = template;
|
||||
else if (strcmp(key, "wheel-down") == 0)
|
||||
on_click_templates[MOUSE_BTN_WHEEL_DOWN] = template;
|
||||
else
|
||||
assert(false);
|
||||
}
|
||||
|
|
|
@ -161,6 +161,8 @@ exposable_default_on_mouse(struct exposable *exposable, struct bar *bar,
|
|||
[MOUSE_BTN_MIDDLE] = "middle",
|
||||
[MOUSE_BTN_RIGHT] = "right",
|
||||
[MOUSE_BTN_COUNT] = "count",
|
||||
[MOUSE_BTN_WHEEL_UP] = "wheel-up",
|
||||
[MOUSE_BTN_WHEEL_DOWN] = "wheel-down",
|
||||
};
|
||||
LOG_DBG("on_mouse: exposable=%p, event=%s, btn=%s, x=%d, y=%d (on-click=%s)",
|
||||
exposable, event == ON_MOUSE_MOTION ? "motion" : "click",
|
||||
|
|
|
@ -17,6 +17,8 @@ enum mouse_button {
|
|||
MOUSE_BTN_LEFT,
|
||||
MOUSE_BTN_MIDDLE,
|
||||
MOUSE_BTN_RIGHT,
|
||||
MOUSE_BTN_WHEEL_UP,
|
||||
MOUSE_BTN_WHEEL_DOWN,
|
||||
|
||||
MOUSE_BTN_COUNT,
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue