From 546fa450ac048cdad9dd5c8fbf0b9fb6ea2bdb66 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 2 Jan 2021 10:03:35 -0600 Subject: Add mouse scrolling binds --- config.org | 76 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/config.org b/config.org index d7b10f9..a0a354c 100644 --- a/config.org +++ b/config.org @@ -955,42 +955,46 @@ For right now, I’m /just/ using Anzu – I don’t like parts of =isearch= but This has to be done /before/ loading the package. It's included in =visual-fill-column=, too, but for some reason isn't loaded there. #+BEGIN_SRC emacs-lisp -(global-set-key [right-margin mouse-1] (global-key-binding [mouse-1])) ; #'mouse-set-point -(global-set-key [right-margin mouse-2] (global-key-binding [mouse-2])) ; #'mouse-yank-primary -(global-set-key [right-margin mouse-3] (global-key-binding [mouse-3])) ; #'mouse-save-then-kill -(global-set-key [right-margin drag-mouse-1] #'ignore) -(global-set-key [right-margin drag-mouse-2] #'ignore) -(global-set-key [right-margin drag-mouse-3] #'ignore) -(global-set-key [right-margin double-mouse-1] #'ignore) -(global-set-key [right-margin double-mouse-2] #'ignore) -(global-set-key [right-margin double-mouse-3] #'ignore) -(global-set-key [right-margin triple-mouse-1] #'ignore) -(global-set-key [right-margin triple-mouse-2] #'ignore) -(global-set-key [right-margin triple-mouse-3] #'ignore) -(global-set-key [left-margin mouse-1] (global-key-binding [mouse-1])) ; #'mouse-set-point -(global-set-key [left-margin mouse-2] (global-key-binding [mouse-2])) ; #'mouse-yank-primary -(global-set-key [left-margin mouse-3] (global-key-binding [mouse-3])) ; #'mouse-save-then-kill -(global-set-key [left-margin drag-mouse-1] #'ignore) -(global-set-key [left-margin drag-mouse-2] #'ignore) -(global-set-key [left-margin drag-mouse-3] #'ignore) -(global-set-key [left-margin double-mouse-1] #'ignore) -(global-set-key [left-margin double-mouse-2] #'ignore) -(global-set-key [left-margin double-mouse-3] #'ignore) -(global-set-key [left-margin triple-mouse-1] #'ignore) -(global-set-key [left-margin triple-mouse-2] #'ignore) -(global-set-key [left-margin triple-mouse-3] #'ignore) - -(mouse-wheel-mode +1) - -(when (bound-and-true-p mouse-wheel-mode) - (global-set-key [right-margin mouse-wheel-down-event] #'mwheel-scroll) - (global-set-key [right-margin mouse-wheel-up-event] #'mwheel-scroll) - (global-set-key [right-margin wheel-down] #'mwheel-scroll) - (global-set-key [right-margin wheel-up] #'mwheel-scroll) - (global-set-key [left-margin mouse-wheel-down-event] #'mwheel-scroll) - (global-set-key [left-margin mouse-wheel-up-event] #'mwheel-scroll) - (global-set-key [left-margin wheel-down] #'mwheel-scroll) - (global-set-key [left-margin wheel-up] #'mwheel-scroll)) + (global-set-key [right-margin mouse-1] (global-key-binding [mouse-1])) ; #'mouse-set-point + (global-set-key [right-margin mouse-2] (global-key-binding [mouse-2])) ; #'mouse-yank-primary + (global-set-key [right-margin mouse-3] (global-key-binding [mouse-3])) ; #'mouse-save-then-kill + (global-set-key [right-margin drag-mouse-1] #'ignore) + (global-set-key [right-margin drag-mouse-2] #'ignore) + (global-set-key [right-margin drag-mouse-3] #'ignore) + (global-set-key [right-margin double-mouse-1] #'ignore) + (global-set-key [right-margin double-mouse-2] #'ignore) + (global-set-key [right-margin double-mouse-3] #'ignore) + (global-set-key [right-margin triple-mouse-1] #'ignore) + (global-set-key [right-margin triple-mouse-2] #'ignore) + (global-set-key [right-margin triple-mouse-3] #'ignore) + (global-set-key [left-margin mouse-1] (global-key-binding [mouse-1])) ; #'mouse-set-point + (global-set-key [left-margin mouse-2] (global-key-binding [mouse-2])) ; #'mouse-yank-primary + (global-set-key [left-margin mouse-3] (global-key-binding [mouse-3])) ; #'mouse-save-then-kill + (global-set-key [left-margin drag-mouse-1] #'ignore) + (global-set-key [left-margin drag-mouse-2] #'ignore) + (global-set-key [left-margin drag-mouse-3] #'ignore) + (global-set-key [left-margin double-mouse-1] #'ignore) + (global-set-key [left-margin double-mouse-2] #'ignore) + (global-set-key [left-margin double-mouse-3] #'ignore) + (global-set-key [left-margin triple-mouse-1] #'ignore) + (global-set-key [left-margin triple-mouse-2] #'ignore) + (global-set-key [left-margin triple-mouse-3] #'ignore) + + (mouse-wheel-mode +1) + + (when (bound-and-true-p mouse-wheel-mode) + (global-set-key [right-margin mouse-wheel-down-event] #'mwheel-scroll) + (global-set-key [right-margin mouse-wheel-up-event] #'mwheel-scroll) + (global-set-key [right-margin wheel-down] #'mwheel-scroll) + (global-set-key [right-margin wheel-up] #'mwheel-scroll) + (global-set-key [left-margin mouse-wheel-down-event] #'mwheel-scroll) + (global-set-key [left-margin mouse-wheel-up-event] #'mwheel-scroll) + (global-set-key [left-margin wheel-down] #'mwheel-scroll) + (global-set-key [left-margin wheel-up] #'mwheel-scroll) + (global-set-key [right-margin mouse-4] #'mwheel-scroll) + (global-set-key [right-margin mouse-5] #'mwheel-scroll) + (global-set-key [left-margin mouse-4] #'mwheel-scroll) + (global-set-key [left-margin mouse-5] #'mwheel-scroll)) #+END_SRC *** Load the package -- cgit 1.4.1-21-gabe81