Created
February 8, 2024 12:09
-
-
Save 1player/e5cc0740f97b7148d3fc90bb1d598b41 to your computer and use it in GitHub Desktop.
Emacs two finger gestures to scroll back and forth
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
(defun debounce (time fn) | |
(let ((ready t)) | |
(lambda () | |
(interactive) | |
(when ready | |
(funcall fn) | |
(setq ready nil) | |
(run-at-time time nil (lambda () (setq ready t))))))) | |
(global-set-key (kbd "<triple-wheel-right>") (debounce "0.25 sec" #'previous-buffer)) | |
(global-set-key (kbd "<triple-wheel-left>") (debounce "0.25 sec" #'next-buffer)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment