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: Tue, 10 Aug 2021 15:44:44 +0300

> From: Robert Pluim <[email-masked]>
> Cc: Didier <[email-masked]>,  [email-masked]
> Date: Mon, 09 Aug 2021 12:29:32 +0200
> 
>     >> So I think it should be modified to something like:
>     >> 
>     >> (if (or (featurep 'w32-win) (and (display-graphic-p) (featurep 'ns-win)))
>     >> 'wheel-down
>     >> 'mouse-5)
> 
>     Eli> Did you try that?
> 
>     Eli> The problem here is that the initial frame is not a GUI frame even in
>     Eli> a GUI session, so the defcustom could pick up the wrong value.
> 
> If we knew where and how the events were being received by emacs we
> could map them to wheel-{up,down}, but Iʼve not succeeded there.

Where were you looking?  These events are formatted into Lisp in
keyboard.c; search for "wheel-".

I guess the difference is between systems where the GUI API tells us
explicitly whether its a wheel-up/down event, and systems where we
just get "button number N" event.  Or something like that.