From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Didier Newsgroups: gmane.emacs.bugs Subject: 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 Date: Sun, 1 Aug 2021 23:44:05 -0700 Message-ID: References: <83a6m1ofgi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e060de05c88de5d4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34030"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49803@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 02 08:45:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mARhF-0008bU-7w for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Aug 2021 08:45:09 +0200 Original-Received: from localhost ([::1]:42984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mARhD-0006Rp-SV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Aug 2021 02:45:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mARh8-0006Qb-3K for bug-gnu-emacs@gnu.org; Mon, 02 Aug 2021 02:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mARh7-0001Fe-Qg for bug-gnu-emacs@gnu.org; Mon, 02 Aug 2021 02:45:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mARh7-0005Pc-Ms for bug-gnu-emacs@gnu.org; Mon, 02 Aug 2021 02:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Didier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Aug 2021 06:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49803 X-GNU-PR-Package: emacs Original-Received: via spool by 49803-submit@debbugs.gnu.org id=B49803.162788666420750 (code B ref 49803); Mon, 02 Aug 2021 06:45:01 +0000 Original-Received: (at 49803) by debbugs.gnu.org; 2 Aug 2021 06:44:24 +0000 Original-Received: from localhost ([127.0.0.1]:37565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mARgW-0005Oc-DX for submit@debbugs.gnu.org; Mon, 02 Aug 2021 02:44:24 -0400 Original-Received: from mail-yb1-f173.google.com ([209.85.219.173]:41760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mARgT-0005OO-UU for 49803@debbugs.gnu.org; Mon, 02 Aug 2021 02:44:22 -0400 Original-Received: by mail-yb1-f173.google.com with SMTP id z18so182113ybg.8 for <49803@debbugs.gnu.org>; Sun, 01 Aug 2021 23:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FyEXJqu1XH5kjBKzOtpWGIuGVRHXF3LPz0OLEtxUh5I=; b=iKGrKDkoLI3InniXqTyx1SpHIEDH2Kjf/m8yfeq11KWZ8kciyN2wvNlyFDp8TZVREx jZxcf17JShFr2yxS+bZBUOBQVWRVNtPqUnDnoz7mOsMFNhd88tQwYqcwsI//tsDv4nc7 H2f5yzwOV42Arcji3ZwZcKzX94nyc77v/dci4WLdMysql+L9NuPion2cVD0/NuVjLRHZ Lb/7qvTLp0ceKro+QxAPOwQvuMV0bQ8xUbGdz1hHv0zMZB8Cp/rmO0XgZ71ZN6t9msKg 74sIlGgYRmRS3inoM2DLg89iGUDMl/njnGP0McQL5Z4iGYsXoDOsF4KTbDxHZV80OdCR UDWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FyEXJqu1XH5kjBKzOtpWGIuGVRHXF3LPz0OLEtxUh5I=; b=HiiFujnUvTh+1ralmO1QJqsfE0/oTEa2SvkF/1Ksqq0gU8gnV+Y41KIIsSF+IYWBgB QtSgeS/QztafsCIUd/S6rVgdWPQgxednB1DxhApeC33B/Vgq/Vabh+B7UVUxNFiS4g++ NxBYfRxHu2Tzs3GsObDFXYsfRRPT/VkklTE+ZDhFdjrZIQfS3Ed3277Tt8RFLffcEZor 2ds5lArGt4VnrUmvh0DAwH8vIclakYsB8b2UcLz5xqwvZEpAQaEIgnJSCtb1lft1Aq2X SjwImF6NTbbC4FGGYiH4Oa/pepPRlwWSA+tdurF/qjtnuOlE0tolvhxspxYYSTIYars/ /Ctg== X-Gm-Message-State: AOAM532d528NxUU/U1E5TOH29tynZ+GLKQ/unvblhQ8+ioHgn2IG3kBA xi+VID8wQkbV7IJwtYudg44tWMgTXNmWW1LjckE= X-Google-Smtp-Source: ABdhPJyKLRS2iX+XNJox3x1GjZv6+78NAzhicdVKUXeJKxLghO3OG1xUBNq8SoNx6UVIMhfiP5+x22QJhyfYwp8fOec= X-Received: by 2002:a25:a527:: with SMTP id h36mr20088335ybi.104.1627886656182; Sun, 01 Aug 2021 23:44:16 -0700 (PDT) In-Reply-To: <83a6m1ofgi.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211061 Archived-At: --000000000000e060de05c88de5d4 Content-Type: text/plain; charset="UTF-8" In macOS, when running Emacs in GUI, the wheel is received as and and it all works. But in macOS, when running inside a terminal such as Terminal.app or iTerm2, the wheel is received as and and it no longer works, because the defcustom is not smart enough to check if we are running in GUI or not. 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) Does that make sense? On Sat, 31 Jul 2021 at 23:18, Eli Zaretskii wrote: > > From: Didier > > Date: Sat, 31 Jul 2021 19:27:58 -0700 > > > > I'm on a MacBook Pro with macOS Big Sur, and on both the laptop trackpad > > and with my plugged in USB mouse, the wheel or 2-finger up/down on > > trackpad, is reported to Emacs when in terminal as mouse-4 and mouse-5. > > That means that scroll doesn't work in Terminal.app or in iTerm2 on MAC, > > since mouse-4 and mouse-5 are not bound. > > > > In the GUI Mac it works, because it gets reported as wheel-up and > > wheel-down. > > > > My thought is maybe here > > https://github.com/emacs-mirror/emacs/blob/master/lisp/mwheel.el#L54 > > there should be an additional check for if its running with a > > window-system or not? > > I don't think I follow. The defcustoms there say: > > (defcustom mouse-wheel-down-event > (if (or (featurep 'w32-win) (featurep 'ns-win)) > 'wheel-up > 'mouse-4) > "Event used for scrolling down." > :group 'mouse > :type 'symbol > :set 'mouse-wheel-change-button) > > (defcustom mouse-wheel-up-event > (if (or (featurep 'w32-win) (featurep 'ns-win)) > 'wheel-down > 'mouse-5) > "Event used for scrolling up." > :group 'mouse > :type 'symbol > :set 'mouse-wheel-change-button) > > This seems already to cater to macOS, so why isn't it working for you? > --000000000000e060de05c88de5d4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In macOS, when running Emacs in GUI, the wheel is rec= eived as <wheel-up> and <wheel-down> and it all works.

But in macOS, when running inside a terminal such as Termi= nal.app or iTerm2, the wheel is received as <mouse-4> and <mouse-5= > and it no longer works, because the defcustom is not smart enough to c= heck if we are running in GUI or not.

So I think i= t should be modified to something like:

(if (or (f= eaturep 'w32-win) (and (display-graphic-p) (featurep &= #39;ns-win)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 'wheel-down
=C2=A0 =C2=A0 =C2=A0 'mouse-5)

Does that make = sense?

On Sat, 31 Jul 2021 at 23:18, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Didier <didibus@gmail.com>
> Date: Sat, 31 Jul 2021 19:27:58 -0700
>
> I'm on a MacBook Pro with macOS Big Sur, and on both the laptop tr= ackpad
> and with my plugged in USB mouse, the wheel or 2-finger up/down on
> trackpad, is reported to Emacs when in terminal as mouse-4 and mouse-5= .
> That means that scroll doesn't work in Terminal.app or in iTerm2 o= n MAC,
> since mouse-4 and mouse-5 are not bound.
>
> In the GUI Mac it works, because it gets reported as wheel-up and
> wheel-down.
>
> My thought is maybe here
> https://github.com/emacs-mi= rror/emacs/blob/master/lisp/mwheel.el#L54
> there should be an additional check for if its running with a
> window-system or not?

I don't think I follow.=C2=A0 The defcustoms there say:

=C2=A0 (defcustom mouse-wheel-down-event
=C2=A0 =C2=A0 (if (or (featurep 'w32-win) (featurep 'ns-win))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 'wheel-up
=C2=A0 =C2=A0 =C2=A0 'mouse-4)
=C2=A0 =C2=A0 "Event used for scrolling down."
=C2=A0 =C2=A0 :group 'mouse
=C2=A0 =C2=A0 :type 'symbol
=C2=A0 =C2=A0 :set 'mouse-wheel-change-button)

=C2=A0 (defcustom mouse-wheel-up-event
=C2=A0 =C2=A0 (if (or (featurep 'w32-win) (featurep 'ns-win))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 'wheel-down
=C2=A0 =C2=A0 =C2=A0 'mouse-5)
=C2=A0 =C2=A0 "Event used for scrolling up."
=C2=A0 =C2=A0 :group 'mouse
=C2=A0 =C2=A0 :type 'symbol
=C2=A0 =C2=A0 :set 'mouse-wheel-change-button)

This seems already to cater to macOS, so why isn't it working for you?<= br>
--000000000000e060de05c88de5d4--