From 938c2402c0444f52257f8d5a4513f2f6898db084 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 12 Oct 2025 12:08:31 -0500 Subject: feat: mousetrap-mode: move mousetrap-mode from wip into module --- modules/wip.el | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'modules/wip.el') diff --git a/modules/wip.el b/modules/wip.el index 0fae57e3..6c7c8845 100644 --- a/modules/wip.el +++ b/modules/wip.el @@ -70,41 +70,6 @@ :bind ("M-p" . pomm) :commands (pomm pomm-third-time)) -;; ------------------------------ Mouse Trap Mode ------------------------------ - -(defvar mouse-trap-mode-map - (let* ((prefixes '("" "C-" "M-" "S-" "C-M-" "C-S-" "M-S-" "C-M-S-")) ; modifiers - (buttons (number-sequence 1 5)) ; mouse-1..5 - (types '("mouse" "down-mouse" "drag-mouse" - "double-mouse" "triple-mouse")) - (wheel '("wheel-up" "wheel-down" "wheel-left" "wheel-right")) - (map (make-sparse-keymap))) - ;; clicks, drags, double, triple - (dolist (type types) - (dolist (pref prefixes) - (dolist (n buttons) - (define-key map (kbd (format "<%s%s-%d>" pref type n)) #'ignore)))) - ;; wheel - (dolist (evt wheel) - (dolist (pref prefixes) - (define-key map (kbd (format "<%s%s>" pref evt)) #'ignore))) - map) - "Keymap for `mouse-trap-mode'. Unbinds almost every mouse event. - -Disabling mouse prevents accidental mouse moves modifying text.") - -(define-minor-mode mouse-trap-mode - "Globally disable most mouse and trackpad events. - -When active, , , , -, , and wheel events are bound to `ignore', -with or without C-, M-, S- modifiers." - :global t - :lighter " 🐭" - :keymap mouse-trap-mode-map) -(global-set-key (kbd "C-c M") #'mouse-trap-mode) -(mouse-trap-mode 1) - ;; --------------------- Debug Code For Package Signatures --------------------- ;; from https://emacs.stackexchange.com/questions/233/how-to-proceed-on-package-el-signature-check-failure -- cgit v1.2.3