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

Keyd changes the default keycode for 'Fn' on my macbook #791

Open
celesrenata opened this issue Jul 9, 2024 · 3 comments
Open

Keyd changes the default keycode for 'Fn' on my macbook #791

celesrenata opened this issue Jul 9, 2024 · 3 comments

Comments

@celesrenata
Copy link

Love your work!

I was hoping I could figure out a quick and dirty patch for my T2 Macbook.

I see that insrc/keys.h the FN key is mapped to 254, however, I need to map it to 464!

I tried changing the array to allow upto 465 to mimic your logic and changed the corresponding for loop in src/keys.c
unfortunately after recompiling it comes back as key 208!

I was wondering if you had any ideas on how I could patch this to work on my mac.

Thanks!
Celes

@rvaiya
Copy link
Owner

rvaiya commented Jul 26, 2024

I see that insrc/keys.h the FN key is mapped to 254, however, I need to map it to 464!

That is keyd's internal code. It should be mapped to KEY_FN on input, which should be correctly defined by your kernel headers as 464.

Have you tried running keyd monitor and inspecting the output? You should see something like fn down with a blank config.

If not, can you post the output of sudo evtest1 while pressing the key? It is also possible that the hardware doesn't actually emit a distinct event for fn, which is a common problem on laptop keyboards.

Footnotes

  1. Make sure keyd is disabled and that you select your physical board from the list.

@szabba
Copy link

szabba commented Aug 10, 2024

Not OP, but my situation on an M1 Macbook sounds similar. Not sure if I should open a separate issue for it.

When I run sudo keyd monitor I get entries for most remapped keys. There's not output when I press leftcontrol (remmapped to layer(alt) in the main layer.

What seems to be the relevant part of sudo evtest output (with keyd stopped) is:

Event: time 1723288312.142961, -------------- SYN_REPORT ------------
Event: time 1723288312.173686, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1723288312.173686, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1723288312.173686, -------------- SYN_REPORT ------------
Event: time 1723288312.827211, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1723288312.827211, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1723288312.827211, -------------- SYN_REPORT ------------

The config (cobbled together through trial and error)

[ids]
k:05ac:0281

[global]
default_layout = pl

[main]
delete = backspace

rightmeta = layer(altgr)
rightalt = rightcontrol

leftcontrol = layer(fn)
fn = leftcontrol
leftmeta = alt
leftalt = leftmeta

home = C-left
end = C-right
pageup = C-up
pagedown = C-down

brightnessdown = f1
brightnessup = f2
scale = f3
search = f4
record = f5
sleep = f6
previoussong = f7
playpause = f8
nextsong = f9
mute = f10
volumedown = f11
volumeup = f12

[fn]
left = home
right = end
up = pageup
down = pagedown

f1 = brightnessdown
f2 = brightnessup
f3 = scale
f4 = search
f5 = record
f6 = sleep
f7 = previoussong
f8 = playpause
f9 = nextsong
f10 = mute
f11 = volumedown
f12 = volumeup

@themg95
Copy link

themg95 commented Oct 9, 2024

Are there any updates on this? I can't access the second layer of my touchbar, which seems to be related to this issue.

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