Skip to content

Instantly share code, notes, and snippets.

@betaveros
Created January 9, 2017 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betaveros/fdda01cffd72fbe116087bfedfd5128d to your computer and use it in GitHub Desktop.
Save betaveros/fdda01cffd72fbe116087bfedfd5128d to your computer and use it in GitHub Desktop.
Karabiner XML for mapping fn+- (fn-hyphen) to a legitimate minus sign, cobbled together from sone online sources I forget
<?xml version="1.0"?>
<root>
<item>
<name>Change fn+- to (minus sign)</name>
<appendix>You need to enable Unicode Hex Input and U.S. input sources.</appendix>
<identifier>private.fn_minus</identifier>
<autogen>__KeyToKey__
KeyCode::MINUS, ModifierFlag::FN,
<!-- change input source to Unicode -->
KeyCode::VK_CHANGE_INPUTSOURCE_UNICODEHEXINPUT,
<!-- wait until input source was changed -->
KeyCode::VK_WAIT_10MS,
KeyCode::VK_WAIT_10MS,
KeyCode::VK_WAIT_10MS,
<!-- put minus -->
KeyCode::KEY_2, ModifierFlag::OPTION_L,
KeyCode::KEY_2, ModifierFlag::OPTION_L,
KeyCode::KEY_1, ModifierFlag::OPTION_L,
KeyCode::KEY_2, ModifierFlag::OPTION_L,
<!-- restore input source -->
KeyCode::VK_CHANGE_INPUTSOURCE_US,
<!-- suppress key repeating -->
Option::NOREPEAT,
</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment