Skip to content

Commit

Permalink
fix weird behavior after normal scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
quintenroets committed Aug 26, 2024
1 parent 489d77b commit a7e3bd3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,13 @@ static int event_handler(struct event *ev)
* Treat scroll events as mouse buttons so oneshot and the like get
* cleared.
*/

kev.code = ev->devev->x == 0 ? ((int)ev->devev->y > 0 ? KEYD_SCROLL_UP : KEYD_SCROLL_DOWN): KEYD_EXTERNAL_MOUSE_BUTTON;
const struct descriptor *mapping = active_kbd? get_active_layer_mapping(active_kbd, kev.code): NULL;
if (active_kbd) {
kev.code = ev->devev->x == 0 ? ((int)ev->devev->y > 0 ? KEYD_SCROLL_UP : KEYD_SCROLL_DOWN): KEYD_EXTERNAL_MOUSE_BUTTON;
if (mapping == NULL){
kev.code = KEYD_EXTERNAL_MOUSE_BUTTON;
}
kev.pressed = 1;
kev.timestamp = ev->timestamp;

Expand All @@ -511,7 +516,6 @@ static int event_handler(struct event *ev)
kev.pressed = 0;
timeout = kbd_process_events(ev->dev->data, &kev, 1);
}
const struct descriptor *mapping = active_kbd? get_active_layer_mapping(active_kbd, kev.code): NULL;
if (mapping == NULL) {
vkbd_mouse_scroll(vkbd, ev->devev->x, ev->devev->y);
}
Expand Down

0 comments on commit a7e3bd3

Please sign in to comment.