Intercept F keys

Hello!

I'm almost certain that BTT does not work on that level to accomplish what I'll ask, but let me try, maybe there is another workaround.

I used to use Karabiner Elements that work on a lower level and intercepted F keys when running certain apps (e.g., a game).

Normally some of my F keys are bound to perform certain macOS actions (like launch pad, show desktop, notifications, dictation etc.)

Many apps (including games) that work full screen, allow you to bind F keys to perform some actions (especially games), I would like to be able to intercept the native macOS binds of F keys so that they can be sent to the running app as normal F keys and stop propagate to macOS actions.

Is that possible with BTT or my initial concern for the level that BTT works is correct?

Thanks!

UPDATE:
If it is not possible to intercept, I believe a workaround could be to invert the intention, meaning that I could set the F keys to work as normal Function keys in macOS, and set the actions I need via BTT in All Apps, and then remap the F keys for the apps I need them to work as normal function keys, correct? Would the shortcut in All Apps overall with the same shortcut for a specific app?

UPDATE2:
The workaround above works fine, but I would love to know if I could intercept the F keys without having to remove all the shortcuts from macOS settings and then rebind them in BTT.

That should work, just record the key you want to override and assign the F key you want to send:

That is what I was trying but it didn't work.

So, by pressing F4 it launches the launchpad, but for instance, I don't want that behaviour to happen in a specific app, so I added this:

But, unfortunately, the F4 still launches the launchpad instead of passing F4 (the same happens with all other F buttons).

PS: I'm not using Apple Keyboard, I'm on Das Keyboard Professional 4 for Mac

in your case not the launchpad key was recorded as trigger but instead the f4 key. Are you sure the launchpad functionality was active when you created the trigger?

I'm sorry maybe I wasn't clear in my wording. I used Launchpad only as an example, my goal is to intercept the F* keys. When for example I bind F4 to open the launchpad from inside the Keyboard Shortcuts settings in macOS, then, I cannot bind F4 for a specific app to perform another action or to work plainly as F4 (same goes for other F* buttons).

I have the same question/issue. Just upgraded M1 MacBook Pro from Catalina to Sequoia. Now when I press the F5/microphone key it brings up the OS's dictation. In previous OS I had assigned a custom behavior to simply pressing that key (in all apps,) and it worked flawlessly. It seems the OS gets the keypress before BTT does now.

Can BTT intercept that keypress and not allow the system to bring up dictation but do my preferred action instead? Of course the question is for all function keys, but this one particular for me.

I tried changing the keyboard mapping/shortcuts in Sequoia System Preferences, but it seems I have to actually turn dictation on to possibly do that, and I do not use dictation. Hence my interest in using that key for something else.

So I suppose I could do the system option to pass F-key numbers and setup BTT to re-map them all as suggested above. Checking in to see if that's still necessary.

Alternatively, is there any reason NOT to use https://karabiner-elements.pqrs.org to re-map that key instead of BTT doing all the F-keys?

PS I haven't found in forum search any other conversations about the OS grabbing the F-keys issue. Have I missed something?

I think you just need to re-record them in BTT as the identifiers have slightly changed

I have repeatedly tried re-recording the keypress. Here's what happens, shown in attached screenshot:

  • I have the "Use F1, F2, etc keys as standard function keys" turned OFF
  • NOTE: If I press the F5 key any time now, the "Do you want to enable Dictation?" dialog box pops up, and nothing else happens.
  • In BTT config I click in the field to record the keystroke, then I press F5, it records it as shown in the screenshot "fn [?] Mic Key" and nothing further happens (as expected)
  • When I press F5 now, I get the same behavior as before, the Dictation dialog pops up and my BTT action does not execute

So even though BTT seems to note the new identifier, the OS is still taking the keypress action instead of BTT.

NOTE: If I assign Fn-F5 (hold Fn/Globe key and press F5) then BTT functions as expected using that keycombo. It's just F5 by itself that's the problem. And to be clear, it's exactly the same issue with F6/Moon or any others I want to change.

AND, I'll add this here though maybe it's really a different issue...

I tried the workaround to turn the "standard function keys" option ON and mapping the F-keys to brigthness & volume control etc. That works acceptably... BUT another issue cropped up: I have a separate KeySequence trigger of BrightnessDown, BrightnessUp (1 keypress each, in sequence) which no longer triggers after I re-record them (as F1, F2) It does work with the "standard function keys" OFF and them recorded as BrightDown, BrightUp. So seem the F-keys are not behaving well in a key sequence. Not sure if they ever did since I wasn't setup as F-keys before.

weird, I have been using the keys fine on Sequoia (without switching modes). But yes, if you switch modes they are basically completely different keys.

I’ll check tomorrow whether I can think of anything, maybe some permission issue or something like that.

1 Like

That permissions idea might be relevant... When I first ran BTT after upgrade I thought I saw some kind of permission or confirmation dialog pop up, but it was obscured immediately by other windows that were happening and had disappeared when I went looking for it shortly after. I figured it somehow proceeded without needing an answer, but perhaps it noted who-knows-what response by picking up an unintended keystroke I suppose. Maybe. Thx for checking it out.