Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #72070

Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c

Path csiph.com!goblin3!goblin.stu.neva.ru!news.mb-net.net!open-news-network.org!aioe.org!bofh.it!news.nic.it!robomod
From Salvatore Bonaccorso <carnil@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c
Date Wed, 02 Jun 2021 17:30:02 +0200
Message-ID <ClAYG-6ee-23@gated-at.bofh.it> (permalink)
References <C8VxU-89x-9@gated-at.bofh.it> <CiWCl-8px-1@gated-at.bofh.it> <CiXoJ-tr-5@gated-at.bofh.it> <nMuG7-3Oy-23@gated-at.bofh.it> <CiYE9-1mW-3@gated-at.bofh.it> <nMuG7-3Oy-23@gated-at.bofh.it> <CiYE9-1mW-3@gated-at.bofh.it>
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Wed Jun 2 15:27:11 2021
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -2.4
Reply-To Salvatore Bonaccorso <carnil@debian.org>, 757356@bugs.debian.org
Original-Sender Salvatore Bonaccorso <salvatore.bonaccorso@gmail.com>
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc Debian Kernel Team <debian-kernel@lists.debian.org>
X-Debian-Pr-Message followup 757356
X-Debian-Pr-Package src:linux
X-Debian-Pr-Keywords patch
X-Debian-Pr-Source linux
X-Gm-Message-State AOAM531rR/hqKPxEVsobyZe3eD7bzBDkNcVY/KF1qEdU5sicnveYStu5 H64C90/GmbhDCmmVn7l+ug2inRwBTjd23A==
X-Google-SMTP-Source ABdhPJwaAQkERK0y+dwZ6iixYsJ2iqVC5AR7Hyyw1Aa41hf8kVWoE4E4ani/LbEKkCTAdQNowCpH8w==
X-Received by 2002:a17:907:3f97:: with SMTP id hr23mr35962765ejc.49.1622647479745; Wed, 02 Jun 2021 08:24:39 -0700 (PDT)
Sender robomod@news.nic.it
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1666458
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 110
Organization linux.* mail to news gateway
X-Original-Date Wed, 2 Jun 2021 17:24:38 +0200
X-Original-Message-ID <YLeitmdmsErNOHIg@eldamar.lan>
X-Original-References <E1lbnDi-001LSU-6w@hullmann.westfalen.local> <20210526075216.GA212882@zira.vinc17.org> <20210526083911.GA214851@zira.vinc17.org> <20140807115944.GA4501@xvii.vinc17.org> <20210526100212.GA276962@zira.vinc17.org> <20140807115944.GA4501@xvii.vinc17.org> <20210526100212.GA276962@zira.vinc17.org>
X-Original-Sender Salvatore Bonaccorso <salvatore.bonaccorso@gmail.com>
Xref csiph.com linux.debian.bugs.dist:1060937 linux.debian.kernel:72070

Cross-posted to 2 groups.

Show key headers only | View raw


Hi Vincent,

On Wed, May 26, 2021 at 12:02:12PM +0200, Vincent Lefevre wrote:
> Control: retitle -1 Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c
> Control: tags -1 patch
> 
> On 2021-05-26 10:39:11 +0200, Vincent Lefevre wrote:
> > And the cursor keys. Actually, all the keys corresponding to
> > 
> > static const struct applespi_key_translation applespi_fn_codes[] = {
> >         { KEY_BACKSPACE, KEY_DELETE },
> >         { KEY_ENTER,    KEY_INSERT },
> >         { KEY_F1,       KEY_BRIGHTNESSDOWN,     APPLE_FLAG_FKEY },
> >         { KEY_F2,       KEY_BRIGHTNESSUP,       APPLE_FLAG_FKEY },
> >         { KEY_F3,       KEY_SCALE,              APPLE_FLAG_FKEY },
> >         { KEY_F4,       KEY_DASHBOARD,          APPLE_FLAG_FKEY },
> >         { KEY_F5,       KEY_KBDILLUMDOWN,       APPLE_FLAG_FKEY },
> >         { KEY_F6,       KEY_KBDILLUMUP,         APPLE_FLAG_FKEY },
> >         { KEY_F7,       KEY_PREVIOUSSONG,       APPLE_FLAG_FKEY },
> >         { KEY_F8,       KEY_PLAYPAUSE,          APPLE_FLAG_FKEY },
> >         { KEY_F9,       KEY_NEXTSONG,           APPLE_FLAG_FKEY },
> >         { KEY_F10,      KEY_MUTE,               APPLE_FLAG_FKEY },
> >         { KEY_F11,      KEY_VOLUMEDOWN,         APPLE_FLAG_FKEY },
> >         { KEY_F12,      KEY_VOLUMEUP,           APPLE_FLAG_FKEY },
> >         { KEY_RIGHT,    KEY_END },
> >         { KEY_LEFT,     KEY_HOME },
> >         { KEY_DOWN,     KEY_PAGEDOWN },
> >         { KEY_UP,       KEY_PAGEUP },
> >         { }
> > };
> > 
> > in drivers/input/keyboard/applespi.c.
> > 
> > Just in case, in /etc/modprobe.d/hid_apple.conf, I have
> > 
> > options hid_apple fnmode=2
> > options hid_apple iso_layout=0
> 
> But since I'm using hid_apple, I should have taken
> drivers/hid/hid-apple.c, which has the same kind of code:
> 
> static const struct apple_key_translation apple_fn_keys[] = {
>         { KEY_BACKSPACE, KEY_DELETE },
>         { KEY_ENTER,    KEY_INSERT },
>         { KEY_F1,       KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
>         { KEY_F2,       KEY_BRIGHTNESSUP,   APPLE_FLAG_FKEY },
>         { KEY_F3,       KEY_SCALE,          APPLE_FLAG_FKEY },
>         { KEY_F4,       KEY_DASHBOARD,      APPLE_FLAG_FKEY },
>         { KEY_F5,       KEY_KBDILLUMDOWN,   APPLE_FLAG_FKEY },
>         { KEY_F6,       KEY_KBDILLUMUP,     APPLE_FLAG_FKEY },
>         { KEY_F7,       KEY_PREVIOUSSONG,   APPLE_FLAG_FKEY },
>         { KEY_F8,       KEY_PLAYPAUSE,      APPLE_FLAG_FKEY },
>         { KEY_F9,       KEY_NEXTSONG,       APPLE_FLAG_FKEY },
>         { KEY_F10,      KEY_MUTE,           APPLE_FLAG_FKEY },
>         { KEY_F11,      KEY_VOLUMEDOWN,     APPLE_FLAG_FKEY },
>         { KEY_F12,      KEY_VOLUMEUP,       APPLE_FLAG_FKEY },
>         { KEY_UP,       KEY_PAGEUP },
>         { KEY_DOWN,     KEY_PAGEDOWN },
>         { KEY_LEFT,     KEY_HOME },
>         { KEY_RIGHT,    KEY_END },
>         { }
> };
> 
> In the conditions from hidinput_apple_event(), the only ones that
> should match according to my settings are
> 
>         if (usage->code == fn_keycode) {
> 
> and
> 
>         if (fnmode) {
> 
> and these are the keys (when trans is true, for fnmode) for which I do
> not get a scan code event. Said otherwise, if hidinput_apple_event()
> returns 1, I do not get a scan code event. There are input_event()
> calls, but I suppose that they will just generate an EV_KEY event,
> and EV_MSC is the one that is missing.
> 
> Note: in hid-apple.c, apple_event() calls hidinput_apple_event(), and
> one has
> 
> static struct hid_driver apple_driver = {
> [...]
>         .event = apple_event,
> [...]
> };
> module_hid_driver(apple_driver);
> 
> I forgot that there was
> 
>   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757356#35
> 
> from Daniel Lin, with a patch, in 2017. I've looked at this patch
> (but have not tried it), and it adds an additional EV_MSC event
> when hidinput_apple_event() has to generate an EV_KEY event. So
> I confirm that should solve this issue and I'm adding the patch
> tag (I don't know whether the patch needs an update, though).

Can you, time permitting, starting from there (and needed refreshes)
try to confirm if the patch solves the issue on top of 5.10.40? If so,
next step would be to propose the change/report the bug at least, to
upstream, get_maintainers.pl would suggest to report it to:

Jiri Kosina <jikos@kernel.org> (maintainer:HID CORE LAYER)
Benjamin Tissoires <benjamin.tissoires@redhat.com> (maintainer:HID CORE LAYER)
linux-input@vger.kernel.org (open list:HID CORE LAYER)
linux-kernel@vger.kernel.org (open list)

Regards,
Salvatore

Back to linux.debian.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#757356: Scan codes still not generated for F1 to F12, Enter and Backspace Vincent Lefevre <vincent@vinc17.net> - 2021-05-26 10:00 +0200
  Bug#757356: Scan code event not generated for some keys of the Apple keyboard: those in applespi_fn_codes Vincent Lefevre <vincent@vinc17.net> - 2021-05-26 10:50 +0200
    Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c Vincent Lefevre <vincent@vinc17.net> - 2021-05-26 12:10 +0200
      Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c Salvatore Bonaccorso <carnil@debian.org> - 2021-06-02 17:30 +0200
        Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c Vincent Lefevre <vincent@vinc17.net> - 2021-07-19 17:00 +0200
        Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c Vincent Lefevre <vincent@vinc17.net> - 2021-07-21 16:30 +0200
          Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c Daniel Lin <ephemient@gmail.com> - 2021-07-22 00:40 +0200
            Bug#757356: Apple keyboard: Scan code event (EV_MSC) not generated when the EV_KEY event is generated by hid-apple.c Vincent Lefevre <vincent@vinc17.net> - 2021-07-26 16:20 +0200

csiph-web