pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful tool for customizing keyboards on macOS
https://karabiner-elements.pqrs.org/
The Unlicense
18.94k stars 839 forks source link

Incorrect function key behaviors in new M1 MacBook Air #2516

Open xiao-zang opened 4 years ago

xiao-zang commented 4 years ago

The newly released MacBook Air with M1 processor has the following change to the function keys:

F4: Launchpad --> Spotlight F5: Decrease keyboard brightness --> Dictation F6: Increase keyboard brightness --> Toggle do not disturb

Turning on Karabiner Elements overrides those new defaults to the defaults of old keyboard layouts. Also, since Spotlight, Dictation and Toggle do not disturb are not included in the function key settings of Karabiner Elements Preferences, I cannot manually modify those function keys to what they are supposed to do on this new Mac (unless I turn off Karabiner Elements).

Therefore, could you add those three functions (Spotlight, Dictation and Toggle do not disturb) to the function key settings in Karabiner Elements Preferences? Then the users of new MacBook Air can change the functions of F4-F6 to match the new layout. Automatically detecting the new M1 model and adjusting the default settings to match the new layout will be a plus, but is not urgent.

Thank you!

rickybright commented 4 years ago

Exactly this. Adding them as functions might also benefit people using multiple computers by having key consistency.

taylornd commented 4 years ago

Spot on. I thought dictation wasn't working until I discovered this thread

Muirium commented 3 years ago

Another M1 Air user here looking forward to this fix! Consistency with function key legends is appreciated. (Indeed, those new legends are the one sneaky little physical tell for these all new Macs.)

mrtolkien commented 3 years ago

Same issue here, is there a possible workaround while this is getting worked on? As long as we know the keycode those new functions are supposed to send, it should be pretty easy to change their behaviour.

Muirium commented 3 years ago

I have tried that approach. You can remap Do Not Disturb to any key you like (so I used the underlying F-key) but Dictation doesn’t show up in System Preferences so I haven’t been able to restore that second key.

Ideally, assuming these new function keys are added to Karabiner, I’d map both of them to physical F-keys on my external keyboards too.

anzksdk commented 3 years ago

just figure this out, here is how I do it

image image image image
taylornd commented 3 years ago

Brilliant. Just waiting for the crash fix now and we are good to go...

Muirium commented 3 years ago

Reassigning the Dictation key to F5 didn't seem to work for me. But then I disabled Siri, system-wide, and the modification sticks. There seems to be some kind of squabbling between the two functions (which Mac OS expects to be on the same key, one as quick press and one as hold). But as long as Siri isn't involved, dictation works.

Dictation mode is a little trigger-happy about turning off on key release however! Half the time I press F5 to trigger it, it immediately cancels. Native support for the Dictation key in Karabiner will be welcome for sure!

Also: Spotlight doesn't work well on F4. I have Command + Space deep wired into my mind, having been on the Mac back in Tiger when it first appeared. So I don't want to move Spotlight's main trigger. It does gave a secondary mode (to bring up a Finder window with an active Spotlight search) but assigning that to F4 in Sys Prefs just doesn't seem to do anything. EventViewer shows F4 is firing fine, but the system is plain ignoring it.

ryankhart commented 3 years ago

@anzksdk Thank you for those screenshots!

I ended up rebinding the Spotlight, Dictation, and Do Not Disturb function buttons as F13, F14, and F15 respectively just in case I end up using some obscure app in the future that requires me to actually use F10, F11, or F12. Anything after F12 usually seems to be a blank slate as most keyboards don't even have those keys on the keyboard.

DETstru commented 3 years ago

Throwing in another hat to the want-to-see and update mix. thanks

tekezo commented 3 years ago

Thank you for feedbacks! I've added spotlight and dictation key at the latest beta version.

How to upgrade Karabiner-Elements to the latest beta version: https://karabiner-elements.pqrs.org/docs/manual/operation/check-for-updates/

Screen Shot 2020-12-23 at 22 32 42

I'm searching the HID usage page / usage of toggle do not distrub key, however it is not found yet. Please assign shortcut for Do Not Disturb as above.

Muirium commented 3 years ago

Brilliant! Just installed and loving the update. Leaving F6 mapped to F6, and Do Not Disturb set to F6 in Preferences, works well enough. The real win is getting Spotlight and Dictate keys back, as they were fiddlier. You have my gratitude!

Now I wonder where Apple tucked away the Do Not Disturb HID code, and indeed why!

mattPiratt commented 3 years ago

@anzksdk Thank you for those screenshots!

I ended up rebinding the Spotlight, Dictation, and Do Not Disturb function buttons as F13, F14, and F15 respectively just in case I end up using some obscure app in the future that requires me to actually use F10, F11, or F12. Anything after F12 usually seems to be a blank slate as most keyboards don't even have those keys on the keyboard.

Hi. How did you map F15 to DND? I am unable to set anything there, other than F1~F12

ryankhart commented 3 years ago

Hi. How did you map F15 to DND? I am unable to set anything there, other than F1~F12

@mattPiratt, Great question. I had forgotten, myself, when I read your question. The trick is the first reassign the F4, F5, and F6 keys to F13, F14, and F15 respectively inside the Karabiner Elements app first. Then, in System Preferences, whenever you press the F6 key, MacOS thinks you're pressing F15 instead. image

neffepito commented 3 years ago

Thank you for feedbacks! I've added spotlight and dictation key at the latest beta version.

How to upgrade Karabiner-Elements to the latest beta version: https://karabiner-elements.pqrs.org/docs/manual/operation/check-for-updates/

Screen Shot 2020-12-23 at 22 32 42

I'm searching the HID usage page / usage of toggle do not distrub key, however it is not found yet. Please assign shortcut for Do Not Disturb as above.

Bravo, bro!

Derad6709 commented 3 years ago

Still unresolved DND, settings is image

AGluk commented 3 years ago

Hello.

Also waiting for DND as default! Now use F6 for DND toggle. Anyway - your tool is great! Thanks!

kiracus commented 3 years ago

Hi, @tekezo Does this API work for DnD?

Thanks

tekezo commented 3 years ago

Thank you for feedback! I have tried kHIDUsage_GD_DoNotDisturb on this branch, but it didn't work, unfortunately.

https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/tree/wont-merge/kHIDUsage_GD_DoNotDisturb

jspiro commented 3 years ago

Is there simply a way to disable remapping of these keys? I don't actually need the function row remapped at all.

Muirium commented 3 years ago

Same here: on the internal keyboard.

Different story on all external keyboards, however. There, I turn F1 through F12 into a similar arrangement as the Mac's function row (namely Brightness etc. not F1 etc.).

How I achieve this right now is manually spelling it all out in Karabiner. A bit laborious.

jspiro commented 3 years ago

I ended up mapping DND to F18 in Keyboards and doing the same with F6 in Karabiner. It works perfectly, if inconvenient. I'd prefer to simply disable remapping for the key, but it's fine! Fn+F6 still produces F6, so I'm happy!

rileyjshaw commented 2 years ago

+1 to @jspiro’s proposal. I don’t need the function row remapped, so it’s frustrating that I need to apply workarounds just to have the default behavior.

sweenzor commented 2 years ago

Any movement here?

lioliy commented 2 years ago

F5: Decrease keyboard brightness --> Dictation(press)/SIri(press and hold) can you add this feature

andreaswilli commented 2 years ago

May I ask why there is no option to stop Karabiner from messing with the function keys?

All I want is vim arrow keys and swap Caps Lock and Esc.

huyz commented 2 years ago

@andreaswilli You may already know this, but you can remap the Caps Lock key to Esc in the macOS System Preferences (as for the Esc key, do you really need Caps Lock? I thought no one used that anymore). You also may want to check out https://kindavim.app/

andreaswilli commented 2 years ago

@huyz Didn't know about the Caps Lock setting, thanks. The only thing I use Caps Lock for is typing capital umlauts (ÄÖÜ) with the Swiss-German keyboard layout. But I can also use ¨+A and so on so that's fine, I guess.

kindaVim looks interesting, gonna give it a try.

yurylavrukhin commented 2 years ago

This workaround for DND key worked for me https://github.com/pqrs-org/Karabiner-Elements/issues/2901#issuecomment-987784376

jgermade commented 2 years ago

I think that the best solution would be to allow in 'Function keys' settings to specify which keys we want to override and ignore the other.

Miss that function when figured out this problem with the Mac M1. Also could be fine for any future scenarios.

sweenzor commented 2 years ago

Thank you for feedback! I have tried kHIDUsage_GD_DoNotDisturb on this branch, but it didn't work, unfortunately.

https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/tree/wont-merge/kHIDUsage_GD_DoNotDisturb

Think there have been any updates to this API @tekezo?

sweenzor commented 1 year ago

Hiya, bumping this issue again. Any joy @tekezo? Thanks for your help.

sweenzor commented 1 year ago

I ended up mapping DND to F18 in Keyboards and doing the same with F6 in Karabiner. It works perfectly, if inconvenient. I'd prefer to simply disable remapping for the key, but it's fine! Fn+F6 still produces F6, so I'm happy!

This would be a great workaround imo for apple not properly exposing the right interface for dnd @tekezo, leave the whole function row untouched by Karabiner.

Thanks!

nejmeijer commented 2 months ago

It seems the original problem has been solved and that further comments discuss are about something else. Please create a new issue if the latter problem is still relevant.

sweenzor commented 2 months ago

Hi @nejmeijer! as far as I can tell:

I think this issue is still relevant.

Thank you for all you do on this project!

image

Screenshot 2024-09-05 at 3 29 25 PM

nejmeijer commented 2 months ago

Thank you for the detailed description!

lucasec commented 1 month ago

Thank you for feedback! I have tried kHIDUsage_GD_DoNotDisturb on this branch, but it didn't work, unfortunately.

https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/tree/wont-merge/kHIDUsage_GD_DoNotDisturb

@tekezo Hey, curious if this keycode has been tested since the new 15.1.0 changes that make the Kababiner virtual keyboard more closely emulate an Apple keyboard. The vendor ID could have been the missing piece that prevented this from working in the past.

torarnv commented 1 month ago

I was hit by this, but didn't realize I could fix the dictation key by mapping it manually, as it was under "media keys". Perhaps rename that category, as it includes more than just play/pause/volume/etc?

sweenzor commented 1 month ago

DoNotDisturb does not show up under "media keys" or anywhere else.

On Mon, Oct 14 2024 at 4:44 AM, Tor Arne Vestbø < @.*** > wrote:

I was hit by this, but didn't realize I could fix the dictation key by mapping it manually, as it was under "media keys". Perhaps rename that category, as it includes more than just play/pause/volume/etc?

— Reply to this email directly, view it on GitHub ( https://github.com/pqrs-org/Karabiner-Elements/issues/2516#issuecomment-2410473242 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AABT24QSHBZ2BMQVD2BWBEDZ3N76LAVCNFSM4T4BSOOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENBRGA2DOMZSGQZA ). You are receiving this because you are subscribed to this thread. Message ID: <pqrs-org/Karabiner-Elements/issues/2516/2410473242 @ github. com>