]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tty mouse wheel on window systems other than X
authorPo Lu <luangruo@yahoo.com>
Sun, 5 Dec 2021 01:59:45 +0000 (09:59 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 5 Dec 2021 02:01:26 +0000 (10:01 +0800)
* 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.

lisp/mwheel.el

index 6a853a35216827c9927bc525402bd7b7fc3bebb2..9d303b7ee353cac5a6a5edbff527b9ac5465b50d 100644 (file)
   :set 'mouse-wheel-change-button)
 
 (defcustom mouse-wheel-down-alternate-event
-  (when (featurep 'xinput2) 'wheel-up)
+  (if (featurep 'xinput2)
+      'wheel-up
+    (unless (featurep 'x)
+      'mouse-4))
   "Alternative wheel down event to consider."
   :group 'mouse
   :type 'symbol
   :set 'mouse-wheel-change-button)
 
 (defcustom mouse-wheel-up-alternate-event
-  (when (featurep 'xinput2) 'wheel-down)
+  (if (featurep 'xinput2)
+      'wheel-down
+    (unless (featurep 'x)
+      'mouse-5))
   "Alternative wheel up event to consider."
   :group 'mouse
   :type 'symbol
@@ -246,7 +252,10 @@ Also see `mouse-wheel-tilt-scroll'."
   "Event used for scrolling left.")
 
 (defvar mouse-wheel-left-alternate-event
-  (when (featurep 'xinput2) 'wheel-left)
+  (if (featurep 'xinput2)
+      'wheel-left
+    (unless (featurep 'x)
+      'mouse-6))
   "Alternative wheel left event to consider.")
 
 (defvar mouse-wheel-right-event
@@ -257,7 +266,10 @@ Also see `mouse-wheel-tilt-scroll'."
   "Event used for scrolling right.")
 
 (defvar mouse-wheel-right-alternate-event
-  (when (featurep 'xinput2) 'wheel-right)
+  (if (featurep 'xinput2)
+      'wheel-right
+    (unless (featurep 'x)
+      'mouse-7))
   "Alternative wheel right event to consider.")
 
 (defun mouse-wheel--get-scroll-window (event)