practicalli / spacemacs

Content for the book - Clojure Development with Spacemacs
https://practical.li/spacemacs
Creative Commons Attribution Share Alike 4.0 International
110 stars 33 forks source link

Ignoring MacOSX zoom gestures #201

Open practicalli-johnny opened 4 years ago

practicalli-johnny commented 4 years ago

MacOSX has trackpad zoom gestures that work with Spacemacs. However, if they keep triggering accidentally during typing then they can be disabled

The gestures becomes the keypresses <magnify-down> or <magnify-up>

These keys are bound to actions within Emacs itself and not Spacemacs as part of the global-map.

The <magnify-down> or <magnify-up> key bindings can be changed using kbd, which coverts keys to the internal Emacs representation.

 (define-key global-map (kbd "<magnify-up>") nil)
 (define-key global-map (kbd "<magnify-down>") nil)

A more verbose approach would be to call a function that doesn't do anything important. A message could also be added that highlights in the mini-buffer that the key binding was pressed.

(defun practicalli-nothing ()
  (interactive)
  (message "Buttons are not toys") )

(define-key global-map (kbd "<magnify-up>") 'practicalli-nothing)
(define-key global-map (kbd "<magnify-down>") 'practicalli-nothing)

A reference to read https://www.masteringemacs.org/article/mastering-key-bindings-emacs