diff options
Diffstat (limited to 'lisp/mwheel.el')
-rw-r--r-- | lisp/mwheel.el | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/lisp/mwheel.el b/lisp/mwheel.el index cbd78137622..44c4989ad06 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -150,30 +150,18 @@ This can be slightly disconcerting, but some people prefer it." ;;; For tilt-scroll ;;; -(defcustom mwheel-tilt-scroll-p nil +(defcustom mouse-wheel-tilt-scroll nil "Enable scroll using tilting mouse wheel." :group 'mouse :type 'boolean :version "26.1") -(defcustom mwheel-flip-direction nil +(defcustom mouse-wheel-flip-direction nil "Swap direction of 'wheel-right and 'wheel-left." :group 'mouse :type 'boolean :version "26.1") -(defcustom mwheel-scroll-left-function 'scroll-left - "Function that does the job of scrolling left." - :group 'mouse - :type 'function - :version "26.1") - -(defcustom mwheel-scroll-right-function 'scroll-right - "Function that does the job of scrolling right." - :group 'mouse - :type 'function - :version "26.1") - (eval-and-compile (if (fboundp 'event-button) (fset 'mwheel-event-button 'event-button) @@ -211,6 +199,12 @@ This can be slightly disconcerting, but some people prefer it." (defvar mwheel-scroll-down-function 'scroll-down "Function that does the job of scrolling downward.") +(defvar mwheel-scroll-left-function 'scroll-left + "Function that does the job of scrolling left.") + +(defvar mwheel-scroll-right-function 'scroll-right + "Function that does the job of scrolling right.") + (defvar mouse-wheel-left-event (if (or (featurep 'w32-win) (featurep 'ns-win)) 'wheel-left @@ -293,13 +287,13 @@ non-Windows systems." ;; Make sure we do indeed scroll to the end of the buffer. (end-of-buffer (while t (funcall mwheel-scroll-up-function))))) ((eq button mouse-wheel-left-event) ; for tilt scroll - (when mwheel-tilt-scroll-p - (funcall (if mwheel-flip-direction + (when mouse-wheel-tilt-scroll + (funcall (if mouse-wheel-flip-direction mwheel-scroll-right-function mwheel-scroll-left-function) amt))) ((eq button mouse-wheel-right-event) ; for tilt scroll - (when mwheel-tilt-scroll-p - (funcall (if mwheel-flip-direction + (when mouse-wheel-tilt-scroll + (funcall (if mouse-wheel-flip-direction mwheel-scroll-left-function mwheel-scroll-right-function) amt))) (t (error "Bad binding in mwheel-scroll")))) |