diff --git a/kitty/mouse.c b/kitty/mouse.c index f63171529..84355f9f9 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -67,13 +67,11 @@ static char mouse_event_buf[64]; static int encode_mouse_event_impl(const MousePosition *mpos, int mouse_tracking_protocol, int button, MouseAction action, int mods) { - unsigned int cb = 0; + unsigned int cb = encode_button(button); if (action == MOVE) { - cb = encode_button(button); if (cb == UINT_MAX) cb = 3; cb += 32; } else { - cb = encode_button(button); if (cb == UINT_MAX) return 0; } if (action == DRAG || action == MOVE) cb |= MOTION_INDICATOR;