Try to disable accidental mouse font height changes on Darwin

This commit is contained in:
Gerard Vermeulen 2024-06-08 09:27:32 +02:00
parent f7e6c28ce1
commit cbbc3cf3aa

View File

@ -450,7 +450,10 @@ to improve visibility without theming:
Listing [[lst:use-buffer-face-mode-for-fixed-or-variable-pitch-face]] contains
functions to set a fixed or variable pitch face in the current buffer and
selects a fixed pitch face for =magit-mode= and =progmode= buffers. Type
{{{kbd(M-x describe-text-properties)}}} to inspect faces at point.
{{{kbd(M-x describe-text-properties)}}} to inspect faces at point. Listing
[[lst:disable-mac-mouse-change-font-size]] tries to disable accidental changing of
the font size with the mouse on Darwin. Listing [[lst:setup-visual-line-mode]]
configures =visual-line-mode=.
#+caption[Configure =face-attributes=]:
#+caption: Configure =face-attributes=.
@ -583,6 +586,18 @@ verse and quote blocks are fontified using the `org-verse' and
(add-hook 'prog-mode-hook #'set-buffer-fixed-pitch-face)
#+end_src
#+caption[Disable changing font size with mouse on Darwin]:
#+caption: Disable changing font size with mouse on Darwin.
#+name: lst:disable-mac-mouse-change-font-size
#+begin_src emacs-lisp -n :results silent
(when (eq system-type 'darwin)
;; https://lmno.lol/alvaro/hey-mouse-dont-mess-with-my-emacs-font-size
;; Hint: reset font size with "C-u 0 M-x text-scale-adjust".
(global-set-key (kbd "<pinch>") 'ignore)
(global-set-key (kbd "<C-wheel-up>") 'ignore)
(global-set-key (kbd "<C-wheel-down>") 'ignore))
#+end_src
#+caption[Setup ~visual-line-mode~]:
#+caption: Setup ~visual-line-mode~.
#+name: lst:setup-visual-line-mode