Skip to content

Instantly share code, notes, and snippets.

@antifuchs
Created January 27, 2016 21:17
Show Gist options
  • Save antifuchs/7fac00f05d5c404e5c74 to your computer and use it in GitHub Desktop.
Save antifuchs/7fac00f05d5c404e5c74 to your computer and use it in GitHub Desktop.
Put this in `Library/Application Support/Karabiner/private.xml`
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>APPLE_INC</vendorname>
<vendorid>0x05ac</vendorid>
</devicevendordef>
<devicevendordef>
<vendorname>FILCO</vendorname>
<vendorid>0x04d9</vendorid>
</devicevendordef>
<devicevendordef>
<vendorname>KINESIS</vendorname>
<vendorid>0x5f3</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>APPLE_INTERNAL_KEYBOARD_TRACKPAD</productname>
<productid>0x0262</productid>
</deviceproductdef>
<deviceproductdef>
<productname>APPLE_WIRELESS_KEYBOARD_0x022c</productname>
<productid>0x022c</productid>
</deviceproductdef>
<deviceproductdef>
<productname>APPLE_WIRELESS_KEYBOARD_0x022d</productname>
<productid>0x022d</productid>
</deviceproductdef>
<deviceproductdef>
<productname>APPLE_WIRELESS_KEYBOARD_0x0255</productname>
<productid>0x0255</productid>
</deviceproductdef>
<deviceproductdef>
<productname>KINESIS_ERGO_ELAN</productname>
<productid>0x0007</productid>
</deviceproductdef>
<item>
<name>Change Option_R to Enter on apple internal keyboard</name>
<identifier>private.asf.internal-only.option_r.enter</identifier>
<device_only>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_only>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::ENTER</autogen>
</item>
<item>
<name>Change Option_R to Enter on apple ext keyboard 0x022c</name>
<identifier>private.asf.0x022c.option_r.enter</identifier>
<device_only>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_WIRELESS_KEYBOARD_0x022c</device_only>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::ENTER</autogen>
</item>
<item>
<name>Change Option_R to Enter on apple ext keyboard 0x0255</name>
<identifier>private.asf.0x0255.option_r.enter</identifier>
<device_only>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_WIRELESS_KEYBOARD_0x0255</device_only>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::ENTER</autogen>
</item>
<item>
<name>Change Option_R to Enter on apple ext keyboard 0x022d</name>
<identifier>private.asf.0x022d.option_r.enter</identifier>
<device_only>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_WIRELESS_KEYBOARD_0x022d</device_only>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::ENTER</autogen>
</item>
<item>
<name>Change Application (context menu) to Enter on any external keyboard</name>
<identifier>private.asf.non-internal.context-menu.enter</identifier>
<device_not>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_not>
<autogen>__KeyToKey__ KeyCode::PC_APPLICATION, KeyCode::ENTER</autogen>
</item>
<!--
https://github.com/tekezo/KeyRemap4MacBook/blob/master/src/bridge/generator/keycode/data/ConsumerKeyCode.data
has the key defns used here:
-->
<item>
<name>Change PrintScreen/SysReq (F13) to volume down on any external keyboard</name>
<identifier>private.asf.non-internal.f13.volume-down</identifier>
<device_not>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_not>
<autogen>__KeyToKey__ KeyCode::F13, ModifierFlag::NONE, KeyCode::VK_CONSUMERKEY_VOLUME_DOWN</autogen>
</item>
<item>
<name>Change Scroll Lock (F14) to volume up on any external keyboard</name>
<identifier>private.asf.non-internal.f14.volume-up</identifier>
<device_not>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_not>
<autogen>__KeyToKey__ KeyCode::F14, ModifierFlag::NONE, KeyCode::VK_CONSUMERKEY_VOLUME_UP</autogen>
</item>
<item>
<name>Change Ctrl + Scroll Lock (F14) to Play/Pause on any external keyboard</name>
<identifier>private.asf.non-internal.ctrl-f14.play</identifier>
<device_not>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_not>
<autogen>__KeyToKey__
KeyCode::F14, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_PLAY
</autogen>
<autogen>__KeyToKey__
KeyCode::F14, ModifierFlag::CONTROL_R | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_PLAY
</autogen>
</item>
<item>
<name>Change Ctrl + PrintScreen/SysReq (F13) to Previous Song on any external keyboard</name>
<identifier>private.asf.non-internal.ctrl-f13.prev</identifier>
<device_not>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_not>
<autogen>__KeyToKey__
KeyCode::F13, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_PREV
</autogen>
<autogen>__KeyToKey__
KeyCode::F13, ModifierFlag::CONTROL_R | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_PREV
</autogen>
</item>
<item>
<name>Change Ctrl + Pause (F15) to Next Song on any external keyboard</name>
<identifier>private.asf.non-internal.ctrl-f15.next</identifier>
<device_not>DeviceVendor::APPLE_INC, DeviceProduct::APPLE_INTERNAL_KEYBOARD_TRACKPAD</device_not>
<autogen>__KeyToKey__
KeyCode::F15, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_NEXT
</autogen>
<autogen>__KeyToKey__
KeyCode::F15, ModifierFlag::CONTROL_R | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_NEXT
</autogen>
</item>
<!-- Kinesis things -->
<item>
<name>Change Ctrl + Scroll Lock (power button) to Play/Pause on Kinesis</name>
<identifier>private.asf.kinesis.ctrl-power.play</identifier>
<device_only>DeviceVendor::KINESIS, DeviceProduct::KINESIS_ERGO_ELAN</device_only>
<autogen>__KeyToKey__
KeyCode::PC_POWER, ModifierFlag::CONTROL_L | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_PLAY
</autogen>
<autogen>__KeyToKey__
KeyCode::PC_POWER, ModifierFlag::CONTROL_R | ModifierFlag::NONE,
KeyCode::VK_CONSUMERKEY_MUSIC_PLAY
</autogen>
</item>
<item>
<name>Change Help key to kp_enter on kinesis</name>
<identifier>private.asf.kinesis.help.enter</identifier>
<device_only>DeviceVendor::KINESIS, DeviceProduct::KINESIS_ERGO_ELAN</device_only>
<autogen>__KeyToKey__
KeyCode::HELP,
KeyCode::ENTER
</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment