Subject: bug#68796: xterm.c: Convert mouse-4/5/6/7 to wheel-up/down/left/right

From: Po Lu <[email-masked]>
Date: Mon, 04 Mar 2024 09:47:54 +0800

Stefan Monnier <[email-masked]> writes:

> Ping?
>
> I believe this patch should be much less controversial since it allows
> users to get the old behavior back and still keeps the same semantics
> for existing `mouse-wheel-*-event` variables in case some other code
> still generates such events.  It's basically a half-way step between
> what I proposed at first and the status quot.
>
> But I'd like some confirmation that you think it's acceptable, and maybe
> if you could comment on the FIXME included in there (I needed it for
> clicks on the tab-bar, but I don't understand that code).

That would be simple if I could find the FIXME, but it doesn't appear to
be present anywhere in that patch...

>> +  /* Convert pre-XInput2 wheel events represented as mouse-clicks.  */
>> +  if (!xi2)
>> +    {
>> +      Lisp_Object base
>> +        = Fcdr_safe (Fassq (make_fixnum (result->code + 1),
>> +                            Fsymbol_value (Qmouse_wheel_buttons)));
>> +      int wheel
>> +        = NILP (base) ? -1
>> +          : BASE_EQ (base, Qwheel_down)  ? 0
>> +          : BASE_EQ (base, Qwheel_up)    ? 1
>> +          : BASE_EQ (base, Qwheel_left)  ? 2
>> +          : BASE_EQ (base, Qwheel_right) ? 3
>> +          : -1;

This should be surrounded by parentheses.

Thanks.