macOS, Use fn + Command keyboard shortcuts work
Aside from switching between the playback/system control keys and the regular function keys, in macOS the fn key can be used to access keys not available on the keyboard. For example, if a dedicated ⌦ Delete key there isn't present, then fn+⌫ Backspace result in ⌦ Delete.
My problem is that this behaviour doesn't persist for keyboard shortcuts: when used in conjunction with ⌘ Command or ⌃ Control, fn is ignored. This generates a few inconsistencies.
For example, on my 2017 MacBook Pro ⌘ Command+⌫ Backspace will all previous characters in the current line. Given that fn+⌫ Backspace will delete the next character, I would expect ⌘ Command+fn+⌫ Backspace to delete the remaining portion of the line. However, fn gets ignored and this key combination ends up deleting the previous portion of the line.
How can I have access to the "hidden keys" accessible with fn even when ⌘ Command is pressed?
Edit: formatting
Solution 1:
Even with both Backspace ⌫ & Delete ⌦ keys, Cmd ⌘ Delete ⌦ does not clear the line forward of the cursor, even though Cmd ⌘ Backspace ⌫ clears it rearward.
It would appear the inconsistency isn't in the Fn key itself, but in the OS's usage of Cmd ⌘ Delete ⌦ .
Opt ⌥ Delete ⌦ deletes one word forward of the cursor, as does Fn Cmd ⌘ Backspace ⌫ .
Solution 2:
I would argue that there are no 'hidden keys'. Just documented built-in keyboard shortcuts
- Fn-Delete: Forward delete on keyboards that don't have a Forward Delete key. Or use Control-D.
- Fn–Up Arrow: Page Up: Scroll up one page.
- Fn–Down Arrow: Page Down: Scroll down one page.
- Fn–Left Arrow: Home: Scroll to the beginning of a document.
- Fn–Right Arrow: End: Scroll to the end of a document.
Solution 3:
I think you could use the free software Karabiner to remap the Fn key to a custom modifier. You can then create shortcuts for my_modifier_1+Delete ⌦ etc.
The custom modifier would act as an additional modifier and thus stack with other modifiers.
You would have to manually rebind all the shortcuts that previously existed with Fn.
Here is an example of creating a customer modifier in Karabiner.
[
{
"type": "basic",
"from": {
"key_code": "fn",
"modifiers": {
"mandatory": [],
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "my_modifier_1",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "my_modifier_1",
"value": 0
}
}
]
}
]
I have a magic keyboard with an ⏏ button. I've remapped it to the Backspace ⌫ using the following Karabiner Simple modification:
It now works with all other modifier keys!