diff options
| author | Po Lu | 2021-12-05 09:59:45 +0800 |
|---|---|---|
| committer | Po Lu | 2021-12-05 10:01:26 +0800 |
| commit | 133f9a7e940e9696d998284b264dfa6430932c3e (patch) | |
| tree | b7dd7c4468f15b86b8b6129c9254eaef78ae6756 | |
| parent | 5404973916dc5d0b92604d31ad7dca2358bc5b9a (diff) | |
| download | emacs-133f9a7e940e9696d998284b264dfa6430932c3e.tar.gz emacs-133f9a7e940e9696d998284b264dfa6430932c3e.zip | |
Fix tty mouse wheel on window systems other than X
* lisp/mwheel.el (mouse-wheel-down-alternate-event)
(mouse-wheel-up-alternate-event)
(mouse-wheel-left-alternate-event)
(mouse-wheel-right-alternate-event): Set appropriately for
non-X systems.
| -rw-r--r-- | lisp/mwheel.el | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 6a853a35216..9d303b7ee35 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el | |||
| @@ -65,7 +65,10 @@ | |||
| 65 | :set 'mouse-wheel-change-button) | 65 | :set 'mouse-wheel-change-button) |
| 66 | 66 | ||
| 67 | (defcustom mouse-wheel-down-alternate-event | 67 | (defcustom mouse-wheel-down-alternate-event |
| 68 | (when (featurep 'xinput2) 'wheel-up) | 68 | (if (featurep 'xinput2) |
| 69 | 'wheel-up | ||
| 70 | (unless (featurep 'x) | ||
| 71 | 'mouse-4)) | ||
| 69 | "Alternative wheel down event to consider." | 72 | "Alternative wheel down event to consider." |
| 70 | :group 'mouse | 73 | :group 'mouse |
| 71 | :type 'symbol | 74 | :type 'symbol |
| @@ -83,7 +86,10 @@ | |||
| 83 | :set 'mouse-wheel-change-button) | 86 | :set 'mouse-wheel-change-button) |
| 84 | 87 | ||
| 85 | (defcustom mouse-wheel-up-alternate-event | 88 | (defcustom mouse-wheel-up-alternate-event |
| 86 | (when (featurep 'xinput2) 'wheel-down) | 89 | (if (featurep 'xinput2) |
| 90 | 'wheel-down | ||
| 91 | (unless (featurep 'x) | ||
| 92 | 'mouse-5)) | ||
| 87 | "Alternative wheel up event to consider." | 93 | "Alternative wheel up event to consider." |
| 88 | :group 'mouse | 94 | :group 'mouse |
| 89 | :type 'symbol | 95 | :type 'symbol |
| @@ -246,7 +252,10 @@ Also see `mouse-wheel-tilt-scroll'." | |||
| 246 | "Event used for scrolling left.") | 252 | "Event used for scrolling left.") |
| 247 | 253 | ||
| 248 | (defvar mouse-wheel-left-alternate-event | 254 | (defvar mouse-wheel-left-alternate-event |
| 249 | (when (featurep 'xinput2) 'wheel-left) | 255 | (if (featurep 'xinput2) |
| 256 | 'wheel-left | ||
| 257 | (unless (featurep 'x) | ||
| 258 | 'mouse-6)) | ||
| 250 | "Alternative wheel left event to consider.") | 259 | "Alternative wheel left event to consider.") |
| 251 | 260 | ||
| 252 | (defvar mouse-wheel-right-event | 261 | (defvar mouse-wheel-right-event |
| @@ -257,7 +266,10 @@ Also see `mouse-wheel-tilt-scroll'." | |||
| 257 | "Event used for scrolling right.") | 266 | "Event used for scrolling right.") |
| 258 | 267 | ||
| 259 | (defvar mouse-wheel-right-alternate-event | 268 | (defvar mouse-wheel-right-alternate-event |
| 260 | (when (featurep 'xinput2) 'wheel-right) | 269 | (if (featurep 'xinput2) |
| 270 | 'wheel-right | ||
| 271 | (unless (featurep 'x) | ||
| 272 | 'mouse-7)) | ||
| 261 | "Alternative wheel right event to consider.") | 273 | "Alternative wheel right event to consider.") |
| 262 | 274 | ||
| 263 | (defun mouse-wheel--get-scroll-window (event) | 275 | (defun mouse-wheel--get-scroll-window (event) |