Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't turn on F-keys on touchbar on MBP 15,4 #12

Closed
atodorov opened this issue May 24, 2020 · 7 comments
Closed

Can't turn on F-keys on touchbar on MBP 15,4 #12

atodorov opened this issue May 24, 2020 · 7 comments

Comments

@atodorov
Copy link

# uname -r
5.6.13-300.mbp.fc32.x86_64
[root@localhost atodorov]# cat /etc/modprobe.d/hid_apple.conf 
options hid_apple fnmode=2
[root@localhost atodorov]# cat /sys/module/hid_apple/parameters/fnmode 
1

I don't seem to be able to make the touchbar display function keys by default and only show media keys if the Fn key is pressed down.

For some reason the file in /etc/modprobe.d/ doesn't have any effect.

I can change this parameter to 2 after being logged in:

# echo 2 > /sys/module/hid_apple/parameters/fnmode 
[root@localhost atodorov]# cat /sys/module/hid_apple/parameters/fnmode 
2

but that doesn't seem to have any effect. Any ideas ?

Full HW info at:
https://github.com/Dunedan/mbp-2016-linux/tree/master/MacBookPro15%2C4

@mikeeq
Copy link
Owner

mikeeq commented May 25, 2020

You are trying to change the parameter in a wrong module - hid_apple instead of apple_ib_tb.

➜ modinfo apple_ib_tb
filename:       /lib/modules/5.6.13-300.mbp.fc32.x86_64/extra/apple-ib-tb.ko
license:        GPL v2
description:    MacBookPro Touch Bar driver
author:         Ronald Tschalär
alias:          hid:b0003g*v000005ACp00008302
alias:          hid:b0003g*v000005ACp00008102
alias:          hid:b0003g*v00001D6Bp00000301
depends:        apple-ibridge
retpoline:      Y
name:           apple_ib_tb
vermagic:       5.6.13-300.mbp.fc32.x86_64 SMP mod_unload 
parm:           idle_timeout:Default touch bar idle timeout:
    >0 - turn touch bar display off after no keyboard, trackpad, or touch bar input has been received for this many seconds;
         the display will be turned back on as soon as new input is received
     0 - turn touch bar display off (input does not turn it on again)
    -1 - turn touch bar display on (does not turn off automatically)
    -2 - disable touch bar completely (int)
parm:           dim_timeout:Default touch bar dim timeout:
    >0 - dim touch bar display after no keyboard, trackpad, or touch bar input has been received for this many seconds
         the display will be returned to full brightness as soon as new input is received
     0 - dim touch bar display (input does not return it to full brightness)
    -1 - disable timeout (touch bar never dimmed)
    [-2] - calculate timeout based on idle-timeout (int)
parm:           fnmode:Default Fn key mode:
    0 - function-keys only
    [1] - fn key switches from special to function-keys
    2 - inverse of 1
    3 - special keys only
    4 - escape key only (int)
echo 2 > /sys/class/input/*/device/fnmode

@atodorov
Copy link
Author

I got confused by the existing README, sent PR. However I can't verify the fix.

After turning off the computer last night and turning it on again today the touchbar only displays the media buttons and pressing Fn key doesn't change them to F1, F2, etc.

I made sure I don't have any of my hid_apple changes under /etc/modprobe.d but the touchbar appears to start like this from early boot. Previously I've played around with it pressing Fn during early boot and I was able to see the F-x buttons.

@mikeeq
Copy link
Owner

mikeeq commented May 25, 2020

Try to boot MacOS or Windows and then come back to Linux - touchbar likes to freeze sometimes.

@atodorov
Copy link
Author

Try to boot MacOS or Windows and then come back to Linux - touchbar likes to freeze sometimes.

I nuked MacOS so that isn't really an option. This freeze sounds like a legitimate bug which needs to be investigated and fixed. I will check my logs again but I didn't see anything obvious when I posted the previous comment.

@berrfred
Copy link

I have the same problem on 5.6.13 while it is working fine on v5.6.7 and previous kernels.
It seems to be only a visual effect not showing the function keys but if you press on the touchbar it does call the underlying function key ( see roadrunner2/macbook12-spi-driver#46 ).

@mikeeq
Copy link
Owner

mikeeq commented Nov 4, 2022

Should be fixed now!

@mikeeq mikeeq closed this as completed Nov 4, 2022
@allco
Copy link

allco commented Dec 29, 2022

You are trying to change the parameter in a wrong module - hid_apple instead of apple_ib_tb

On my MBP 2019 it is:

modinfo apple_touchbar

Also lsusb helped to identify which input device to use in /sys/class/input/*/device/fnmode (in my case it was /sys/class/input/input9/device/fnmode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants