How to Get Karabiner to Proxy a Key for fn on M0116

seaworthy

28 Jan 2016, 23:01

Anyone know how to configure Karabiner to work on an M0116? I use Karabiner with no problems on my HHKB, but the obvious hurdle to overcome with the M0116 is the lack of any Fn key.

There is an option in Karabiner preferences to “Change backslash key to fn key” which is precisely what I want to do. I think this is supposed to still send the backslash event when the key is tapped but when the key is held, I think it’s supposed to function as fn. But it doesn’t appear to work…when I press and hold fn + [any number key] all I get is the corresponding number printing to screen.

I’ve also tried adding the following to my private.xml file

  <autogen>
      __KeyOverlaidModifier__
      KeyCode::BACKSLASH,
      KeyCode::FN,
      KeyCode::BACKSLASH,
    </autogen>

    <autogen>
      __KeyToKey__
      KeyCode::2, ModifierFlag::FN,
      ConsumerKeyCode::BRIGHTNESS_UP,
    </autogen>

It’s possible this would work, and I’m just not placing it in the proper order sequence. I have placed it at the top and near the bottom (inside the root brackets).

Here are my Devices
[img]
Devices.png
Devices.png (87.29 KiB) Viewed 1572 times
[/img]

Here's what happens in the Even Viewer when I press and hold backspace key

[img]
EventViewer_when_FN_pressed.png
EventViewer_when_FN_pressed.png (56.65 KiB) Viewed 1572 times
[/img]

RyanArr

29 Jan 2016, 19:19

Ugh, I've had issues with this before. The problem is that some of Apple's media keys are classed in Karabiner as "KeyCode" and some are "ConsumerKeyCode". I'm not sure why this is, or why using the wrong one doesn't throw a compile error when you load your private.xml. In any case, all you need to do to fix your code is change `ConsumerKeyCode::BRIGHTNESS_UP` to `KeyCode::BRIGHTNESS_UP`. I tested your code with this one change and it works for me. If you have any more trouble please let me know and I'll be happy to debug it more. Also worth noting that this shouldn't have anything to do with which keyboard you are using.

For reference, here is a list of the correct titles for each of the Apple media keys:
KeyCode::BRIGHTNESS_DOWN
KeyCode::BRIGHTNESS_UP
KeyCode::EXPOSE_ALL
KeyCode::LAUNCHPAD
KeyCode::DASHBOARD
ConsumerKeyCode::MUSIC_PREV
ConsumerKeyCode::MUSIC_PLAY
ConsumerKeyCode::MUSIC_NEXT
ConsumerKeyCode::VOLUME_MUTE
ConsumerKeyCode::VOLUME_DOWN
ConsumerKeyCode::VOLUME_UP

seaworthy

29 Jan 2016, 19:33

@RyanARR -- thanks a lot for your reply. I was able to get brightness up & down and mute, volume up, volume down. But for some reason on the M0116 I couldn't get it to recognize backspace (my proxy for fn) + zero so I just put the mute, up, down on 7,8,9. Those are the critical ones... Couldn't get Karabiner to recognize Expose, Launchpad or Dashboard, but I don't use those much.



<item>
<name>Change backslash key to fn.</name>
<identifier>private.backslash_to_fn</identifier>
<autogen>
__KeyOverlaidModifier__
KeyCode::BACKSLASH,
KeyCode::FN,
KeyCode::BACKSLASH,
</autogen>

<autogen>
__KeyToKey__
KeyCode::1, ModifierFlag::FN,
KeyCode::F1,
ConsumerKeyCode::BRIGHTNESS_DOWN,
</autogen>

<autogen>
__KeyToKey__
KeyCode::2, ModifierFlag::FN,
ConsumerKeyCode::BRIGHTNESS_UP,
</autogen>

<autogen>
__KeyToKey__
KeyCode::7, ModifierFlag::FN,
KeyCode::F7,
ConsumerKeyCode::VOLUME_MUTE,
</autogen>

<autogen>
__KeyToKey__
KeyCode::8, ModifierFlag::FN,
KeyCode::F8,
ConsumerKeyCode::VOLUME_DOWN,
</autogen>

<autogen>
__KeyToKey__
KeyCode::9, ModifierFlag::FN,
KeyCode::F9,
ConsumerKeyCode::VOLUME_UP,
</autogen>

</item>

Post Reply

Return to “Keyboards”