]> git.eshelyaron.com Git - emacs.git/commit
(mouse-wheel-buttons): Map old-style wheel buttons to actual wheel events
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 29 Jan 2024 14:35:09 +0000 (09:35 -0500)
committerEshel Yaron <me@eshelyaron.com>
Wed, 10 Apr 2024 20:30:15 +0000 (22:30 +0200)
commit72ab51c954e7409c94b803af03b0684364be9c73
treead57adc910cc6a90a05d4e2d41b27a595d69d379
parent638659cee14046970d745b8cd645eb937fb1f8df
(mouse-wheel-buttons): Map old-style wheel buttons to actual wheel events

Change the handling of the old X11 convention that uses 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.

* lisp/completion-preview.el (completion-preview--mouse-map):
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
* lisp/edmacro.el (edmacro-fix-menu-commands): Silence warnings.

(cherry picked from commit e720ba6219394d275dd741c5f17feea1ee0bf9af)
etc/NEWS
lisp/completion-preview.el
lisp/edmacro.el
lisp/mouse.el
lisp/mwheel.el
lisp/progmodes/flymake.el
lisp/xt-mouse.el
src/keyboard.c
src/xterm.c