Subject: Re: bug#49803: 27.2; Mouse wheel on MacOS is reported as mouse-4 and mouse-5, but Emacs mwheel seems to use wheel-up/wheel-down instead

From: Eli Zaretskii <[email-masked]>
Date: Wed, 11 Aug 2021 20:38:18 +0300

> From: Robert Pluim <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Wed, 11 Aug 2021 19:10:51 +0200
> 
> Something like this. We can discuss if xterm-mouse-map-buttons should
> default to t on ns-win or not. I think it should, because then using
> the mouse wheel with builtin and external trackpads becomes:
> 
> (require 'mwheel)
> (require 'mouse)
> (xterm-mouse-mode t)
> (mouse-wheel-mode t)
> 
> with no other configuration required.
> 
> diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
> index 72faff8101..7906a6a024 100644
> --- a/lisp/xt-mouse.el
> +++ b/lisp/xt-mouse.el
> @@ -42,6 +42,28 @@
>  
>  (defvar xterm-mouse-debug-buffer nil)
>  
> +(defcustom xterm-mouse-map-buttons
> +  (if (featurep 'ns-win)
> +      t
> +    nil)
> +  "Non-nil if xterm should perfom mouse button mappings.
> +Will use `xterm-mouse-map-buttons-alist' for the mapping.
> +Defaults to t when using macOS for consistency with 'mwheel'."
> +  :type 'boolean
> +  :version "28.1"
> +  :group 'xterm)

So you are saying that by moving this from mwheel.el, we avoid the
danger of using the wrong mapping on TTY frames on macOS?