diff options
| author | Stefan Monnier | 2024-01-29 09:35:09 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2024-04-05 17:04:34 -0400 |
| commit | d859856869f06bf6372370556303ea27c6b0e0e9 (patch) | |
| tree | c826d616a368f64bfd554b9c528ee8b3765b2f8a /src/keyboard.c | |
| parent | 7a41de3d515077e3895fe9201d7786134c82ca26 (diff) | |
| download | emacs-scratch/mouse-wheel-buttons.tar.gz emacs-scratch/mouse-wheel-buttons.zip | |
(mouse-wheel-buttons): Map old-style wheel buttons to actual wheel eventsscratch/mouse-wheel-buttons
Change the handling of the old X11 convention to use mouse-4/5/6/7
events to represent wheel events: instead of asking downstream
packages to use the `mouse-wheel-*-event` variables to know which events
represent wheel events, use new var `mouse-wheel-buttons` to directly
convert those events into the standard `wheel-up/down/left/right` events
used everywhere else.
This will simplify the work of packages which can thus just bind their
commands to `wheel-up/down/left/right`.
* lisp/mouse.el (mouse-wheel-buttons): New custom variable.
* src/keyboard.c (make_lispy_event): Adjust for "wheel-clicks" on the tab-bar.
* src/xterm.c (x_construct_mouse_click): Add `xi2` argument and
obey `mouse-wheel-buttons` variable.
(handle_one_xevent): Adjust calls accordingly.
(syms_of_xterm): Define the `mouse-wheel-buttons` and the
`wheel-up/down/left/right`symbols.
* lisp/xt-mouse.el: Don't require `mwheel` any more.
(xterm-mouse--same-button-p): Delete function.
(xterm-mouse--read-event-sequence): Use `mouse-wheel-buttons`.
* lisp/mwheel.el (mouse-wheel-up-event, mouse-wheel-down-event)
(mouse-wheel-left-event, mouse-wheel-right-event): Make obsolete.
(mouse-wheel-obey-old-style-wheel-buttons): Delete variable.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 91faf4582fa..a06c9116d24 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6639,8 +6639,17 @@ make_lispy_event (struct input_event *event) | |||
| 6639 | 6639 | ||
| 6640 | if (CONSP (event->arg)) | 6640 | if (CONSP (event->arg)) |
| 6641 | return list5 (head, position, make_fixnum (double_click_count), | 6641 | return list5 (head, position, make_fixnum (double_click_count), |
| 6642 | XCAR (event->arg), Fcons (XCAR (XCDR (event->arg)), | 6642 | XCAR (event->arg), |
| 6643 | XCAR (XCDR (XCDR (event->arg))))); | 6643 | /* FIXME: When a mouse-click on a tab-bar is |
| 6644 | converted into a wheel-event we get here something | ||
| 6645 | of an unexpected shape... */ | ||
| 6646 | (CONSP (XCDR (event->arg)) | ||
| 6647 | && CONSP (XCDR (XCDR (event->arg)))) | ||
| 6648 | ? Fcons (XCAR (XCDR (event->arg)), | ||
| 6649 | XCAR (XCDR (XCDR (event->arg)))) | ||
| 6650 | /* ... not knowing what this "unexpected shape" means, | ||
| 6651 | we just use nil. */ | ||
| 6652 | : Qnil); | ||
| 6644 | else if (NUMBERP (event->arg)) | 6653 | else if (NUMBERP (event->arg)) |
| 6645 | return list4 (head, position, make_fixnum (double_click_count), | 6654 | return list4 (head, position, make_fixnum (double_click_count), |
| 6646 | event->arg); | 6655 | event->arg); |