Created
August 23, 2011 14:34
-
-
Save emperorcezar/1165287 to your computer and use it in GitHub Desktop.
Turns on mouse scrolling and interaction using iterm2 (and others).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; turn on mouse wheel scrolling | |
(defun sd-mousewheel-scroll-up (event) | |
"Scroll window under mouse up by five lines." | |
(interactive "e") | |
(let ((current-window (selected-window))) | |
(unwind-protect | |
(progn | |
(select-window (posn-window (event-start event))) | |
(scroll-up 2)) | |
(select-window current-window)))) | |
(defun sd-mousewheel-scroll-down (event) | |
"Scroll window under mouse down by five lines." | |
(interactive "e") | |
(let ((current-window (selected-window))) | |
(unwind-protect | |
(progn | |
(select-window (posn-window (event-start event))) | |
(scroll-down 2)) | |
(select-window current-window)))) | |
(global-set-key (kbd "<mouse-5>") 'sd-mousewheel-scroll-up) | |
(global-set-key (kbd "<mouse-4>") 'sd-mousewheel-scroll-down) | |
(xterm-mouse-mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment