aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/term/w32-win.el35
1 files changed, 8 insertions, 27 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 5e5ebd12123..89093f894d3 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -83,33 +83,14 @@
83;; The following definition is used for debugging scroll bar events. 83;; The following definition is used for debugging scroll bar events.
84;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event)) 84;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event))
85 85
86;; mwheel.el should probably be adapted to accept mouse-wheel events 86;; Handle mouse-wheel events with mwheel.
87;; then this could go. 87;; Normally only mouse-wheel-mode and mwheel-install are autoloaded,
88(defun mouse-wheel-scroll-line (event) 88;; but binding mouse-wheel must be done directly, since those functions
89 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'." 89;; do not recognize mouse-wheel as a valid button.
90 (interactive "e") 90(autoload 'mwheel-scroll "mwheel")
91 (condition-case nil 91(global-set-key [mouse-wheel] 'mwheel-scroll)
92 (if (< (car (cdr (cdr event))) 0) 92(global-set-key [C-mouse-wheel] 'mwheel-scroll)
93 (scroll-up (car mouse-wheel-scroll-amount)) 93(global-set-key [S-mouse-wheel] 'mwheel-scroll)
94 (scroll-down (car mouse-wheel-scroll-amount)))
95 (error nil)))
96
97;; for scroll-in-place.el, this way the -scroll-line and -scroll-screen
98;; commands won't interact
99(setq scroll-command-groups (list '(mouse-wheel-scroll-line)))
100
101(defun mouse-wheel-scroll-screen (event)
102 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'."
103 (interactive "e")
104 (condition-case nil
105 (if (< (car (cdr (cdr event))) 0)
106 (scroll-up)
107 (scroll-down))
108 (error nil)))
109
110;; Bind the mouse-wheel event:
111(global-set-key [mouse-wheel] 'mouse-wheel-scroll-line)
112(global-set-key [C-mouse-wheel] 'mouse-wheel-scroll-screen)
113 94
114(defun w32-drag-n-drop-debug (event) 95(defun w32-drag-n-drop-debug (event)
115 "Print the drag-n-drop EVENT in a readable form." 96 "Print the drag-n-drop EVENT in a readable form."