diff --git a/CHANGELOG.md b/CHANGELOG.md index 6109fac9..27cc543b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ * Sixel “current geometry” query response not being bounded by the current window dimensions (fixes `lsix` output) * Crash on keyboard input when repeat rate was zero (i.e. no repeat). +* Wrong button encoding of mouse buttons 6 and 7 in mouse events. ### Security diff --git a/terminal.c b/terminal.c index bb62195d..5344cc53 100644 --- a/terminal.c +++ b/terminal.c @@ -2369,14 +2369,10 @@ encode_xbutton(int xbutton) case 1: case 2: case 3: return xbutton - 1; - case 4: case 5: + case 4: case 5: case 6: case 7: /* Like button 1 and 2, but with 64 added */ return xbutton - 4 + 64; - case 6: case 7: - /* Same as 4 and 5. Note: the offset should be something else? */ - return xbutton - 6 + 64; - case 8: case 9: case 10: case 11: /* Similar to 4 and 5, but adding 128 instead of 64 */ return xbutton - 8 + 128;