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

F-Keys always interpreted as media controls in Karabiner 15.1+: Regression? #4101

Open
Jendker opened this issue Jan 16, 2025 · 26 comments
Open

Comments

@Jendker
Copy link

Jendker commented Jan 16, 2025

Hello,

I am a long-time user of Karabiner with a setup that worked well until version <15.1. However, in the latest versions, I noticed a change in how F-keys are handled.

Can you clarify why it is no longer possible to map F-keys without them being interpreted as media controls? If I disable Karabiner, the F-keys (without fn) are sent correctly without triggering media functions. From what I understand, this change is due to modifications in the Karabiner driver, but were these changes truly necessary?

I ask because, in the latest versions, following the documentation recommendations and mapping to fn+F-keys causes issues in some games. The games (e.g. League of Legends) no longer recognize standalone F-keys, and I have to manually remap controls from F-keys to fn+F-keys. This feels like a regression compared to versions <15.1.

Would it be possible to restore the previous behavior or provide an option to handle F-keys as before?

Thank you!

@bintoro
Copy link

bintoro commented Feb 8, 2025

Wasn’t this fixed in 15.3?

@Jendker
Copy link
Author

Jendker commented Feb 8, 2025

Not quite. You still need to send the fn+F-key to avoid triggering the media key. E.g. now. both F1 w/o fn modifier and display_brightness_decrement overlap.

@bintoro
Copy link

bintoro commented Feb 8, 2025

Works fine for me. When the F-keys are set up as standard F-keys in macOS settings, fn + Fx produces the corresponding media key. And the other way around.

I re-read your report and tbh it doesn’t really explain clearly the issue you’re having. Did you have some complex modifications sending out fn + Fx key codes and it’s those that have stopped working? Or did you not have any of those and only created the complex modifications to try to fix the problem?

@Gaulomatic
Copy link

Gaulomatic commented Feb 9, 2025

I have the same issue. It worked until a few days ago.

@bintoro
Copy link

bintoro commented Feb 9, 2025

@Gaulomatic What worked until a few days ago? It’s unclear from this thread what the exact problem is. And if something changed in the last few days, it’s probably not Karabiner since there hasn’t been a release in months.

From the original report:

Can you clarify why it is no longer possible to map F-keys without them being interpreted as media controls?

I have no issues producing plain F-keys out of Karabiner or mapping them to whatever else. I don’t think this issue report will lead to anything until someone clearly articulates the problem and posts a minimal configuration example that reproduces it.

@Gaulomatic
Copy link

@bintoro I had my F-key configured in the system as-is, no "use as F-keys" options set. Then I remapped F1-F5 to be the F-keys:

Image

This worked until a few days ago. I didn't update the OS or Karabiner. All F-keys are interpreted as media keys, regardless. On the other hand, configuring it the opposite way, so use them generally as F-keys and then configure those as media keys which you want, works.

Image

It feels like a regression as OP stated.

@bintoro
Copy link

bintoro commented Feb 9, 2025

@Gaulomatic Can’t reproduce. I switched my OS-level setting to the default (F-keys as action/media keys) and mapped F3 to F3 in the “Function Keys” section of Karabiner according to your first screenshot. It works perfectly and triggers the action that I have set F3 as a shortcut for.

Also, it’s not at all clear that this is the same issue as the one OP is experiencing. From the report:

If I disable Karabiner, the F-keys (without fn) are sent correctly without triggering media functions.

This indicates the he has the system-level setting “Use F1… as standard function keys” enabled and has trouble getting Karabiner to respect that. Your issue is that you’re doing a remap which for some reason doesn’t take effect over the default behaviour.

@Gaulomatic
Copy link

Gaulomatic commented Feb 10, 2025

@bintoro From what I see, problem seems to be at least related. The F-key thing was a topic of concern over multiple releases, so I just wanted to let you guys know, that OP is not the only one experiencing problems again. I personally can live with the current state by just flipping it on its head.

I took a look at the open issues and saw nearly 2k 1.2k open ones and decided to contribute to this one instead of opening a separate one. I am thankful for the work you all put in this. If there is something I can provide, let me know.

@bintoro
Copy link

bintoro commented Feb 10, 2025

The F-key thing was a topic of concern over multiple releases

Yeah, that’s why I got interested in this issue. Are you using an Apple or third-party keyboard? Any other keypress-modifying apps running? Have you looked at the output of Karabiner’s EventViewer?

The fact that the issue appeared seemingly out of the blue without updating Karabiner makes it hard to understand how it could be a Karabiner regression.

@slrgt
Copy link

slrgt commented Feb 21, 2025

I'm experiencing this issue with an external keyboard (MX Keys) nothing i change lets me remap f1 or f2 to something else

@bintoro
Copy link

bintoro commented Feb 21, 2025

@slrgt Can you be more specific? If you press, say, F8, are you sure that the keyboard is sending the code for the plain F8 (and not “Play/Pause”)? And Karabiner refuses to map it to something else?

@slrgt
Copy link

slrgt commented Feb 21, 2025 via email

@bintoro
Copy link

bintoro commented Feb 21, 2025

@slrgt What do you mean “impossible”? If you want help, you need to explain clearly

  • what you are doing
  • what is happening
  • what you want to happen instead.

If you have some Logitech software running, that may also affect how things work.

How do i make sure?

By quitting Karabiner and launching Karabiner’s EventViewer only and looking at its output.

@slrgt
Copy link

slrgt commented Feb 21, 2025 via email

@bintoro
Copy link

bintoro commented Feb 21, 2025

Im trying to set f1 on my keyboard to act as f1

Yes but how?

@slrgt
Copy link

slrgt commented Feb 21, 2025

Im trying to set f1 on my keyboard to act as f1

Yes but how?

oh sorry here's the complex modification im using. I use the same one for other keys that arent f keys and it works fine

{
    "description": "Swap f1 with numpad 0 only in Blender \nKeyboard: Logitech MX Keys",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "org.blenderfoundation.blender",
                        "example"
                    ],
                    "file_paths": ["Blender\\.app", "/Applications/Blender.app/Contents/MacOS/Blender"],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "f1",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "keypad_0" }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "org.blenderfoundation.blender",
                        "example"
                    ],
                    "file_paths": ["Blender\\.app", "/Applications/Blender.app/Contents/MacOS/Blender"],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "left_control",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "left_option" }],
            "type": "basic"
        }
    ]
}

@slrgt
Copy link

slrgt commented Feb 21, 2025

I changed my code to use display_brightness_decrement instead of f1 i found about from this #1036 (comment) and it let me change it to another key but not to f1
here's the working code:

{
    "description": "Swap f1 with numpad 0 only in Blender \nKeyboard: Logitech MX Keys",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "org.blenderfoundation.blender",
                        "example"
                    ],
                    "file_paths": ["Blender\\.app", "/Applications/Blender.app/Contents/MacOS/Blender"],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "display_brightness_decrement",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "keypad_0" }],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "org.blenderfoundation.blender",
                        "example"
                    ],
                    "file_paths": ["Blender\\.app", "/Applications/Blender.app/Contents/MacOS/Blender"],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "left_control",
                "modifiers": { "optional": ["any"] }
            },
            "to": [{ "key_code": "left_option" }],
            "type": "basic"
        }
    ]
}

@bintoro
Copy link

bintoro commented Feb 21, 2025

@slrgt Exactly. There may be “F1” printed on the keycap, but if the keyboard is not sending F1 but something else, then that’s up to you to know about it and remap the correct code. Karabiner is great but it doesn’t read minds.

@slrgt
Copy link

slrgt commented Feb 21, 2025

@slrgt Exactly. There may be “F1” printed on the keycap, but if the keyboard is not sending F1 but something else, then that’s up to you to know about it and remap the correct code. Karabiner is great but it doesn’t read minds.

yeah thats fair.

seems like the only thing im missing is to make the to: section to include the modifier fn but i can't seem to figure out how to add it correctly

@bintoro
Copy link

bintoro commented Feb 21, 2025

seems like the only thing im missing is to make the to: section to include the modifier fn

So are you trying to produce F1 or numpad 0 as in the rule you posted? If the former, then yeah, you’ll need to add modifiers: ["fn"] if the “Use F1, F2, etc. keys as standard function keys” in system settings is off. But since your keyboard is sending media keys by default, I would just enable the setting. That way there’s no need to send the fn modifier because macOS will no longer turn an f1 sent by Karabiner back into the brightness down command.

@slrgt
Copy link

slrgt commented Feb 21, 2025

i want to send f1 in blender, i dont want to enable the system setting because outside of blender i want them to work as media keys when using the built in keyboard

@Jendker
Copy link
Author

Jendker commented Feb 22, 2025

For this type of complex modifications I highly recommend Goku, specifically this tutorial will be relevant for you: https://github.com/yqrashawn/GokuRakuJoudo/blob/master/tutorial.md#basic2. You can get Blender's app identifiers using Karabiner-EventViewer.

Anyway, if possible let's keep this issue on topic instead of solving individual issues related to configuration. Thanks!

@bintoro
Copy link

bintoro commented Feb 22, 2025

@Jendker It seems to me this whole issue is invalid. You never provided enough detail for anyone to even try to investigate this. Are you using a third-party keyboard or an Apple one? What’s your function key toggle set to in system settings? Do you have any Karabiner rules dealing with the F-keys?

@Jendker
Copy link
Author

Jendker commented Feb 22, 2025

I appreciate your help but I am not sure what your role in this repository is. Are you a maintainer? It would make sense to discuss this with the owner when he has free cycles. I can wait and so does @Gaulomatic, I think.

@bintoro
Copy link

bintoro commented Feb 22, 2025

@Jendker I’m not a maintainer, just someone who understands how this business with the function keys works.

My suspicion is that all these issues stem from people using third-party keyboards. For example, it’s easy to end up in the situation described in the initial report by having the “Use F1, F2, etc. keys as standard function keys” setting disabled. It doesn’t affect the third-party keyboard, but it does affect Karabiner which pretends to be an Apple keyboard. So, when Karabiner is enabled, fn+F1..12 sends a media key, which is passed through unchanged, while a plain F1..12 also gets turned into a media key by macOS.

But I’m only guessing here, since for some reason the participants in this thread haven’t been willing to disclose the exact circumstances under which they experience the “regression” — with the exception of @slrgt, whose problem was subsequently solved. It’s also common etiquette to provide clear steps to reproduce when reporting bugs.

I can confidently say that, in general, it’s not the case that “it is no longer possible to map F-keys without them being interpreted as media controls”, as claimed in the initial report.

@slrgt
Copy link

slrgt commented Feb 23, 2025

i actually still havent fixed my issue completely because i cant seem to figure out how to include the modifier fn to the code i posted

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