Bug 1216250 - Function, fn keys mismapped on MacBook Pro
Summary: Function, fn keys mismapped on MacBook Pro
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libinput
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Hutterer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-28 22:01 UTC by Christopher Beland
Modified: 2015-10-26 18:34 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-26 18:34:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dmesg.log (102.24 KB, text/plain)
2015-04-28 22:01 UTC, Christopher Beland
no flags Details
grep '.*' /sys/class/dmi/id/*_* 2> /dev/null > dmi.log (611 bytes, text/plain)
2015-04-28 22:02 UTC, Christopher Beland
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Linux Kernel 96771 0 None None None Never

Description Christopher Beland 2015-04-28 22:01:54 UTC
Created attachment 1019904 [details]
dmesg.log

kernel-4.0.0-1.fc22.x86_64
MacBook Pro A1502 EMC 2835

The F1 thru F12 keys on the built-in keyboard all have symbols on them.  The expected behavior, which happens on Fedora 21 with my MacBook Air:
* Pressing the key alone takes the action indicated by the symbol.  For example, F1 dims the screen and F2 brightens it.  F12 increases volume and F11 decreases volume.
* Pressing the key while holding the "fn" key triggers the F-key like on a PC keyboard.  For example, fn+F1 triggers Gnome Help and fn+F11 triggers full-screen.

What is happening on the MacBook Pro:
* Pressing the keys with or without "fn" has the same effect.  For example, both F1 and fn+F1 trigger Gnome Help.

In evemu-record, fn+F1 produces:

E: 31.049084 0004 0004 458810	# EV_MSC / MSC_SCAN             458810
E: 31.049084 0001 003b 0001	# EV_KEY / KEY_F1               1
E: 31.049084 0000 0000 0000	# ------------ SYN_REPORT (0) ----------
E: 31.153012 0004 0004 458810	# EV_MSC / MSC_SCAN             458810
E: 31.153012 0001 003b 0000	# EV_KEY / KEY_F1               0
E: 31.153012 0000 0000 0000	# ------------ SYN_REPORT (0) ----------

Only F1 produces:
E: 59.474766 0004 0004 458810	# EV_MSC / MSC_SCAN             458810
E: 59.474766 0001 003b 0001	# EV_KEY / KEY_F1               1
E: 59.474766 0000 0000 0000	# ------------ SYN_REPORT (0) ----------
E: 59.530687 0004 0004 458810	# EV_MSC / MSC_SCAN             458810
E: 59.530687 0001 003b 0000	# EV_KEY / KEY_F1               0
E: 59.530687 0000 0000 0000	# ------------ SYN_REPORT (0) ----------

No event is produced for the "fn" key.

Comment 1 Christopher Beland 2015-04-28 22:02:34 UTC
Created attachment 1019905 [details]
grep '.*' /sys/class/dmi/id/*_* 2> /dev/null > dmi.log

Comment 2 Christopher Beland 2015-04-29 20:09:58 UTC
libinput-0.14.1-2.fc22.x86_64

Comment 3 Peter Hutterer 2015-04-30 07:47:25 UTC
does the fn key send KEY_FN or no key at all? Also, did this work before?

evdev used to force /sys/module/hid_apple/parameters/fnmode to "2" (default seems to be 0, which is disabled). Does it work like expected if you run
   echo "2" > /sys/module/hid_apple/parameters/fnmode

"2" sets it to function keys first, "1" to multimedia keys first.

I guess we could/should do the same in libinput though arguably it's not really our business but rather that of the DE.

Comment 4 Christopher Beland 2015-04-30 16:43:59 UTC
Nope, no KEY_FN from pressing "fn".

cat /sys/module/hid_apple/parameters/fnmode
reports: 1

echo "2" > /sys/module/hid_apple/parameters/fnmode
has no effect; events are reported the same as before.

Comment 5 Christopher Beland 2015-04-30 16:59:26 UTC
On this hardware, the behavior is exactly the same on Fedora 21 (running Fedora-Live-Workstation-x86_64-21-5.iso on a USB stick).

Comment 6 Hans de Goede 2015-05-15 12:04:54 UTC
Hi,

So this works as desired in F-21, but not in F-22, correct? And you've checked the contents of /sys/module/hid_apple/parameters/fnmode and it is the same in both F-21 and F-22, correct?

Can you see which kernel you are running in F-21 (likely a 3.19 kernel), and then try to download and install that kernel on F-22, boot F-22 using the F-21 kernel and see if that helps ?

You can find a list of all Fedora kernels here:
http://koji.fedoraproject.org/koji/packageinfo?packageID=8

And the latest F-21 3.19 kernel here:
http://koji.fedoraproject.org/koji/buildinfo?buildID=636280

Regards,

Hans

Comment 7 Christopher Beland 2015-05-15 15:26:29 UTC
No, this is broken in the same way in both Fedora 21 (kernel-3.17.4-301.fc21.x86_64) and 22.  All of the diagnostics I performed report the same in both; /sys/module/hid_apple/parameters/fnmode is "1" and changing it to "2" does not help.

Comment 8 Hans de Goede 2015-05-15 17:42:30 UTC
Hi,

(In reply to Christopher Beland from comment #7)
> No, this is broken in the same way in both Fedora 21
> (kernel-3.17.4-301.fc21.x86_64) and 22.  All of the diagnostics I performed
> report the same in both; /sys/module/hid_apple/parameters/fnmode is "1" and
> changing it to "2" does not help.

Ah I see, can you provide the output of "lsusb" please ?

Thanks,

Hans

Comment 9 Christopher Beland 2015-05-26 21:15:13 UTC
[beland@localhost ~]$ lsusb
Bus 002 Device 002: ID 05ac:8406 Apple, Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 05ac:0273 Apple, Inc. 
Bus 001 Device 002: ID 05ac:8290 Apple, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Comment 10 Hans de Goede 2015-05-28 15:10:45 UTC
Hi,

(In reply to Christopher Beland from comment #9)
> Bus 001 Device 003: ID 05ac:0273 Apple, Inc. 

Ok so this is one of the new 2015 keyboard / touchpad combos which are not yet supported, work is ongoing on getting these supported upstream.

Benjamin, do you know if we can add an entry for these to drivers/hid/hid-apple.c to get the fn key to work without breaking the mouse emulation of the trackpad we are relying on for now ?

Regards,

Hans

Comment 11 Benjamin Tissoires 2015-05-28 15:26:03 UTC
(In reply to Hans de Goede from comment #10)
> Benjamin, do you know if we can add an entry for these to
> drivers/hid/hid-apple.c to get the fn key to work without breaking the mouse
> emulation of the trackpad we are relying on for now ?

That is part of the kernel bug #96771 (see the attached 0002-hid.patch). I would expect them to send it. I really don't want to send this on their behalf, but we can try to push them to push these upstream.

Comment 12 Christopher Beland 2015-10-26 18:34:31 UTC
Just updated to kernel-4.2.3-200.fc22.x86_64 today and this is fixed!  (Though now the backtick key produces less-than and tilde produces greater-than.  I'll file that on a separate bug.)


Note You need to log in before you can comment on or make changes to this bug.