Created
December 6, 2020 06:28
-
-
Save jogo3000/6df215f4a30a5fab7be09c7b876e2ab0 to your computer and use it in GitHub Desktop.
Temporarily disables mouse when I'm typing
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
;; Disable mouse on typing | |
(defvar jogo3000/mouse-disabled nil) | |
(use-package disable-mouse) | |
(defun jogo3000/disable-mouse () | |
"Disable mouse." | |
(setq jogo3000/mouse-disabled t) | |
(global-disable-mouse-mode t)) | |
(defun jogo3000/enable-mouse () | |
"Enable mouse." | |
(global-disable-mouse-mode -1) | |
(setq jogo3000/mouse-disabled nil)) | |
(defun jogo3000/temporarily-disable-mouse () | |
"Temporarily disable mouse." | |
(unless jogo3000/mouse-disabled | |
(jogo3000/disable-mouse) | |
(run-with-timer 2 nil 'jogo3000/enable-mouse))) | |
(defun jogo3000/disable-touchpad-mode () | |
"Make it so that touchpad is inactive when I type." | |
(interactive) | |
(add-to-list 'post-self-insert-hook 'jogo3000/temporarily-disable-mouse)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very helpful, thanks!!