mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
fix(macos): disable ctrl+scroll emacs keybindings on macOS
Trackpad momentum can often lead to emacs trying to resize font size by thousands of points. Hence let's disable it, as font size changes are easy enough via C-x C-- and C-x C-=.
This commit is contained in:
@@ -44,5 +44,20 @@
|
||||
;; Set initial frame to fullscreen when Emacs starts.
|
||||
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
|
||||
|
||||
;; Override default ctrl+scroll text size keybindings on macOS to not have any
|
||||
;; effect.
|
||||
(defun siren-mouse-wheel-text-scale (_event)
|
||||
"Custom version of `mouse-wheel-text-scale' which does NOTHING.
|
||||
|
||||
macOS scroll momentum often leads to excessive text size changes
|
||||
when using ctrl-based keybindings right after scrolling up/down.
|
||||
This is very annoying, and in extreme cases locks up Emacs for
|
||||
minutes as it's trying to reach 100,000 font size or something
|
||||
crazy."
|
||||
(interactive (list last-input-event)))
|
||||
|
||||
(global-set-key (kbd "C-<wheel-down>") 'siren-mouse-wheel-text-scale)
|
||||
(global-set-key (kbd "C-<wheel-up>") 'siren-mouse-wheel-text-scale)
|
||||
|
||||
(provide 'siren-core-macos)
|
||||
;;; siren-core-macos.el ends here
|
||||
|
||||
Reference in New Issue
Block a user