Skip to content

Instantly share code, notes, and snippets.

@wmertens
Last active March 12, 2019 19:57
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wmertens/e3541192f1a769eda908 to your computer and use it in GitHub Desktop.
Save wmertens/e3541192f1a769eda908 to your computer and use it in GitHub Desktop.
Use Karabiner (https://pqrs.org/osx/karabiner/) to emulate a http://waytools.com TextBlade as well as add some useful shortcuts for the TextBlade proper.
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>WT</vendorname>
<vendorid>0x000d</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>TB</productname>
<productid>0x0000</productid>
</deviceproductdef>
<item>
<name>TextBlade Emulation Mappings</name>
<modifierdef>TB_EDIT</modifierdef>
<modifierdef>TB_PAGING</modifierdef>
<modifierdef>TB_PAGING_SELECT</modifierdef>
<modifierdef>TB_SELECT</modifierdef>
<modifierdef>TB_GREEN</modifierdef>
<item>
<name>Desired Keyboard Layout</name>
<appendix>Choose one of these</appendix>
<item>
<name>QWERTY</name>
<identifier vk_config="true">option.tbemu.qwerty</identifier>
<appendix>TB QWERTY changes single quote to semicolon, puts semicolon on the green layer</appendix>
</item>
<item>
<name>Colemak</name>
<identifier vk_config="true">option.tbemu_colemak</identifier>
<appendix>Use the TextBlade Colemak layout, see http://colemak.com for more information.</appendix>
<appendix>Using Karabiner to map Colemak fixes global hotkeys</appendix>
<appendix>...and you can use international keyboards</appendix>
<appendix>...but the keyboard viewer is then qwerty</appendix>
<appendix></appendix>
<appendix>If you want to use the OS X Colemak layout,</appendix>
<appendix>you need to change the DOT and COMMA keys on the green layer</appendix>
<appendix>so that they send P instead of SEMICOLON</appendix>
</item>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<name>Edit and Select modes</name>
<appendix>There's also a COMMAND mode which enables pgup/down/home/end/tabbing/desktop switch by holding down Left Command, and EDIT/SELECT+P will tab/untab</appendix>
<identifier>textblade</identifier>
<autogen>__SimultaneousKeyPresses__ KeyCode::D, KeyCode::F, KeyCode::VK_MODIFIER_TB_EDIT</autogen>
<autogen>__KeyToKey__ KeyCode::S, ModifierFlag::TB_EDIT, KeyCode::VK_MODIFIER_TB_SELECT </autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_L, ModifierFlag::TB_EDIT, KeyCode::VK_MODIFIER_TB_PAGING </autogen>
<autogen>__KeyToKey__ KeyCode::S, ModifierFlag::TB_PAGING, KeyCode::VK_MODIFIER_TB_PAGING_SELECT </autogen>
<!-- home row cursor -->
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::TB_EDIT, KeyCode::CURSOR_LEFT </autogen>
<autogen>__KeyToKey__ KeyCode::I, ModifierFlag::TB_EDIT, KeyCode::CURSOR_UP </autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::TB_EDIT, KeyCode::CURSOR_DOWN </autogen>
<autogen>__KeyToKey__ KeyCode::COMMA, ModifierFlag::TB_EDIT, KeyCode::CURSOR_DOWN </autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::TB_EDIT, KeyCode::CURSOR_RIGHT </autogen>
<!-- home row pageup/down - beginning/end of doc -->
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::TB_PAGING, KeyCode::CURSOR_UP, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::I, ModifierFlag::TB_PAGING, KeyCode::PAGEUP </autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::TB_PAGING, KeyCode::PAGEDOWN </autogen>
<autogen>__KeyToKey__ KeyCode::COMMA, ModifierFlag::TB_PAGING, KeyCode::PAGEDOWN </autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::TB_PAGING, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L </autogen>
<!-- next/prev word -->
<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::TB_EDIT, KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L </autogen>
<autogen>__KeyToKey__ KeyCode::O, ModifierFlag::TB_EDIT, KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L </autogen>
<!-- home/end -->
<autogen>__KeyToKey__ KeyCode::M, ModifierFlag::TB_EDIT, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::DOT, ModifierFlag::TB_EDIT, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L </autogen>
<!-- undo/redo -->
<autogen>__KeyToKey__ KeyCode::SEMICOLON, ModifierFlag::TB_EDIT, KeyCode::Z, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::SLASH, ModifierFlag::TB_EDIT, KeyCode::Z, ModifierFlag::COMMAND_L, ModifierFlag::SHIFT_L </autogen>
<!-- undo/redo while selecting -->
<autogen>__KeyToKey__ KeyCode::SEMICOLON, ModifierFlag::TB_SELECT, KeyCode::Z, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::SLASH, ModifierFlag::TB_SELECT, KeyCode::Z, ModifierFlag::COMMAND_L, ModifierFlag::SHIFT_L </autogen>
<!-- cut/copy/paste -->
<autogen>__KeyToKey__ KeyCode::Y, ModifierFlag::TB_EDIT, KeyCode::X, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::H, ModifierFlag::TB_EDIT, KeyCode::C, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::N, ModifierFlag::TB_EDIT, KeyCode::V, ModifierFlag::COMMAND_L </autogen>
<!-- cut/copy/paste while selecting -->
<autogen>__KeyToKey__ KeyCode::Y, ModifierFlag::TB_SELECT, KeyCode::X, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::H, ModifierFlag::TB_SELECT, KeyCode::C, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::N, ModifierFlag::TB_SELECT, KeyCode::V, ModifierFlag::COMMAND_L </autogen>
<!-- Escape key lives on green tab -->
<autogen>__KeyToKey__ KeyCode::TAB, ModifierFlag::TB_GREEN, KeyCode::ESCAPE</autogen>
<!-- tab/untab in edit mode, probably not textblade default -->
<autogen>__KeyToKey__ KeyCode::P, ModifierFlag::TB_EDIT, KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L </autogen>
<autogen>__KeyToKey__ KeyCode::P, ModifierFlag::TB_SELECT, KeyCode::BRACKET_LEFT, ModifierFlag::COMMAND_L </autogen>
<!-- Tabs, screens -->
<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::TB_PAGING, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L </autogen>
<autogen>__KeyToKey__ KeyCode::O, ModifierFlag::TB_PAGING, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L </autogen>
<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::TB_PAGING_SELECT, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::O, ModifierFlag::TB_PAGING_SELECT, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::M, ModifierFlag::TB_PAGING, KeyCode::CURSOR_LEFT, ModifierFlag::CONTROL_L </autogen>
<autogen>__KeyToKey__ KeyCode::DOT, ModifierFlag::TB_PAGING, KeyCode::CURSOR_RIGHT, ModifierFlag::CONTROL_L </autogen>
<!-- select cursors, word/line -->
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::TB_SELECT, KeyCode::CURSOR_LEFT, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::I, ModifierFlag::TB_SELECT, KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::TB_SELECT, KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::COMMA, ModifierFlag::TB_SELECT, KeyCode::CURSOR_DOWN, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::TB_SELECT, KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::TB_SELECT, KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::TB_SELECT, KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::O, ModifierFlag::TB_SELECT, KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::M, ModifierFlag::TB_SELECT, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L, ModifierFlag::SHIFT_L </autogen>
<autogen>__KeyToKey__ KeyCode::DOT, ModifierFlag::TB_SELECT, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L, ModifierFlag::SHIFT_L </autogen>
<!-- green layer symbols -->
<autogen>__KeyToKey__ KeyCode::Q, ModifierFlag::TB_GREEN, KeyCode::KEY_1</autogen>
<autogen>__KeyToKey__ KeyCode::W, ModifierFlag::TB_GREEN, KeyCode::KEY_2</autogen>
<autogen>__KeyToKey__ KeyCode::E, ModifierFlag::TB_GREEN, KeyCode::KEY_3</autogen>
<autogen>__KeyToKey__ KeyCode::R, ModifierFlag::TB_GREEN, KeyCode::KEY_4</autogen>
<autogen>__KeyToKey__ KeyCode::T, ModifierFlag::TB_GREEN, KeyCode::KEY_5</autogen>
<autogen>__KeyToKey__ KeyCode::Y, ModifierFlag::TB_GREEN, KeyCode::KEY_6</autogen>
<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::TB_GREEN, KeyCode::KEY_7</autogen>
<autogen>__KeyToKey__ KeyCode::I, ModifierFlag::TB_GREEN, KeyCode::KEY_8</autogen>
<autogen>__KeyToKey__ KeyCode::O, ModifierFlag::TB_GREEN, KeyCode::KEY_9</autogen>
<autogen>__KeyToKey__ KeyCode::P, ModifierFlag::TB_GREEN, KeyCode::KEY_0</autogen>
<autogen>__KeyToKey__ KeyCode::A, ModifierFlag::TB_GREEN, KeyCode::KEY_1, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::S, ModifierFlag::SHIFT_L, ModifierFlag::TB_GREEN, KeyCode::BACKQUOTE, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::S, ModifierFlag::SHIFT_R, ModifierFlag::TB_GREEN, KeyCode::BACKQUOTE, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::S, ModifierFlag::TB_GREEN, KeyCode::KEY_2, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::D, ModifierFlag::SHIFT_L, ModifierFlag::TB_GREEN, KeyCode::BACKQUOTE</autogen>
<autogen>__KeyToKey__ KeyCode::D, ModifierFlag::SHIFT_R, ModifierFlag::TB_GREEN, KeyCode::BACKQUOTE</autogen>
<autogen>__KeyToKey__ KeyCode::D, ModifierFlag::TB_GREEN, KeyCode::KEY_3, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::F, ModifierFlag::TB_GREEN, KeyCode::KEY_4, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::G, ModifierFlag::TB_GREEN, KeyCode::KEY_5, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::H, ModifierFlag::TB_GREEN, KeyCode::KEY_6, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::TB_GREEN, KeyCode::KEY_7, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::TB_GREEN, KeyCode::KEY_8, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::TB_GREEN, KeyCode::KEY_9, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::SEMICOLON, ModifierFlag::TB_GREEN, KeyCode::KEY_0, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::Z, ModifierFlag::TB_GREEN, KeyCode::EQUAL, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::X, ModifierFlag::SHIFT_L, ModifierFlag::TB_GREEN, KeyCode::MINUS, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::X, ModifierFlag::SHIFT_R, ModifierFlag::TB_GREEN, KeyCode::MINUS, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::X, ModifierFlag::TB_GREEN, KeyCode::MINUS</autogen>
<autogen>__KeyToKey__ KeyCode::C, ModifierFlag::SHIFT_L, ModifierFlag::TB_GREEN, KeyCode::BACKSLASH, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::C, ModifierFlag::SHIFT_R, ModifierFlag::TB_GREEN, KeyCode::BACKSLASH, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::C, ModifierFlag::TB_GREEN, KeyCode::EQUAL</autogen>
<autogen>__KeyToKey__ KeyCode::V, ModifierFlag::TB_GREEN, KeyCode::BRACKET_LEFT, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::B, ModifierFlag::TB_GREEN, KeyCode::BRACKET_RIGHT, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::N, ModifierFlag::TB_GREEN, KeyCode::BRACKET_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::M, ModifierFlag::TB_GREEN, KeyCode::BRACKET_RIGHT</autogen>
<autogen>__KeyToKey__ KeyCode::COMMA, ModifierFlag::TB_GREEN, KeyCode::SEMICOLON</autogen>
<autogen>__KeyToKey__ KeyCode::DOT, ModifierFlag::TB_GREEN, KeyCode::SEMICOLON, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::SLASH, ModifierFlag::TB_GREEN, KeyCode::BACKSLASH</autogen>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<name>Activate Green Layer by spacebar</name>
<appendix>Holding down spacebar and typing on the 3 rows covered by TextBlade will insert symbols.</appendix>
<identifier>textblade-green-spacebar</identifier>
<autogen>__KeyOverlaidModifier__ KeyCode::SPACE, KeyCode::VK_MODIFIER_TB_GREEN, KeyCode::SPACE </autogen>
<!-- Only fire when releasing the spacebar after releasing another key -->
<block>
<modifier_only>ModifierFlag::TB_GREEN</modifier_only>
<autogen>__BlockUntilKeyUp__ KeyCode::SPACE</autogen>
</block>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<name>Activate Green Layer by right-command</name>
<appendix>Holding down right command and typing on the 3 rows covered by TextBlade will insert symbols.</appendix>
<appendix>You will have to use the left command key for OS X key commands</appendix>
<identifier>textblade-green-command</identifier>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::VK_MODIFIER_TB_GREEN</autogen>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<name>Right Pinkie Danger</name>
<appendix>On the TextBlade the right pinkie gets backspace and return much closer.</appendix>
<appendix>Enable this to get the same. Semicolon and colon are comma and dot on the green layer.</appendix>
<identifier>textblade-danger</identifier>
<autogen>__KeyToKey__ KeyCode::BRACKET_LEFT, ModifierFlag::TB_GREEN, KeyCode::DELETE, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::BRACKET_RIGHT, ModifierFlag::TB_GREEN, KeyCode::FORWARD_DELETE </autogen>
<autogen>__KeyToKey__ KeyCode::BRACKET_LEFT, KeyCode::DELETE</autogen>
<autogen>__KeyToKey__ KeyCode::BRACKET_RIGHT, KeyCode::DELETE</autogen>
<autogen>__KeyToKey__ KeyCode::DELETE, ModifierFlag::TB_GREEN, KeyCode::FORWARD_DELETE </autogen>
<autogen>__KeyToKey__ KeyCode::QUOTE, KeyCode::RETURN</autogen>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<name>Right Pinkie All The Way</name>
<appendix>Map all the top-right keys to backspace, since delete is much easier to find by touch on the TextBlade</appendix>
<identifier>textblade-danger-continued</identifier>
<autogen>__KeyToKey__ KeyCode::BRACKET_RIGHT, ModifierFlag::TB_GREEN, KeyCode::FORWARD_DELETE </autogen>
<autogen>__KeyToKey__ KeyCode::BACKSLASH, ModifierFlag::TB_GREEN, KeyCode::FORWARD_DELETE </autogen>
<autogen>__KeyToKey__ KeyCode::BRACKET_RIGHT, KeyCode::DELETE</autogen>
<autogen>__KeyToKey__ KeyCode::BACKSLASH, KeyCode::DELETE</autogen>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<!-- from https://github.com/tekezo/Karabiner/blob/version_10.6.0/src/core/server/Resources/include/checkbox/standards/shift.xml -->
<name>Shift_L to Shift_L</name>
<appendix>(+ When you type Shift_L only, Sticky Shift_L)</appendix>
<appendix>(+ When you type Shift_L twice, Capslock)</appendix>
<identifier>tb.remap.shiftl_to_sticky_shiftl</identifier>
<modifierdef notify="false">EXTRA3</modifierdef>
<autogen>
__KeyOverlaidModifier__
<!-- from -->
KeyCode::SHIFT_L, ModifierFlag::EXTRA3,
<!-- to -->
KeyCode::SHIFT_L,
<!-- overlaid -->
KeyCode::CAPSLOCK,
KeyCode::VK_STICKY_SHIFT_L_FORCE_OFF,
KeyCode::VK_STICKY_EXTRA3_FORCE_OFF,
KeyCode::VK_CONFIG_TOGGLE_notsave_shiftl_capslocktrick,
</autogen>
<autogen>
__KeyOverlaidModifier__
<!-- from -->
KeyCode::SHIFT_L,
<!-- to -->
KeyCode::SHIFT_L,
<!-- overlaid -->
KeyCode::VK_STICKY_SHIFT_L,
KeyCode::VK_STICKY_EXTRA3,
</autogen>
</item>
<item>
<name>Enable me</name>
<appendix>Required, don't know how to force this on</appendix>
<identifier>tbemu.remapping</identifier>
<block>
<!-- Put this here so edit mode defs are in qwerty -->
<config_only>option.tbemu.qwerty</config_only>
<device_not>DeviceVendor::WT</device_not>
<autogen>__KeyToKey__ KeyCode::SEMICOLON, KeyCode::QUOTE</autogen>
</item>
<block>
<config_only>option.tbemu_colemak</config_only>
<device_not>DeviceVendor::WT</device_not>
<autogen>__KeyToKey__ KeyCode::E, KeyCode::F</autogen>
<autogen>__KeyToKey__ KeyCode::R, KeyCode::P</autogen>
<autogen>__KeyToKey__ KeyCode::T, KeyCode::G</autogen>
<autogen>__KeyToKey__ KeyCode::Y, KeyCode::J</autogen>
<autogen>__KeyToKey__ KeyCode::U, KeyCode::L</autogen>
<autogen>__KeyToKey__ KeyCode::I, KeyCode::U</autogen>
<autogen>__KeyToKey__ KeyCode::O, KeyCode::Y</autogen>
<autogen>__KeyToKey__ KeyCode::P, KeyCode::QUOTE</autogen>
<autogen>__KeyToKey__ KeyCode::S, KeyCode::R</autogen>
<autogen>__KeyToKey__ KeyCode::D, KeyCode::S</autogen>
<autogen>__KeyToKey__ KeyCode::F, KeyCode::T</autogen>
<autogen>__KeyToKey__ KeyCode::G, KeyCode::D</autogen>
<autogen>__KeyToKey__ KeyCode::J, KeyCode::N</autogen>
<autogen>__KeyToKey__ KeyCode::K, KeyCode::E</autogen>
<autogen>__KeyToKey__ KeyCode::L, KeyCode::I</autogen>
<autogen>__KeyToKey__ KeyCode::SEMICOLON, KeyCode::O</autogen>
<autogen>__KeyToKey__ KeyCode::N, KeyCode::K</autogen>
</item>
</item>
<item>
<device_not>DeviceVendor::WT</device_not>
<name>Mouse Keys</name>
<appendix>You can move mouse pointer by e+ikjl keys, and scroll by e+r+ikjl keys.</appendix>
<appendix></appendix>
<appendix>Usage:</appendix>
<appendix></appendix>
<appendix>Move pointer by:</appendix>
<appendix><![CDATA[ * Left: E down -> J down -> J up ]]></appendix>
<appendix><![CDATA[ * Down: E down -> K down -> K up ]]></appendix>
<appendix><![CDATA[ * Up: E down -> I down -> I up ]]></appendix>
<appendix><![CDATA[ * Right: E down -> K down -> K up ]]></appendix>
<appendix></appendix>
<appendix>The ikjl keys also act as mouse keys when you hold d+ikjl keys down.</appendix>
<appendix>(You can adjust timeout by "__BlockUntilKeyUp__ Timeout" in "Key Repeat" tab.</appendix>
<appendix></appendix>
<appendix>Use R key to enable scroll.</appendix>
<appendix>* E+R+IKJL: Scroll wheel.</appendix>
<appendix></appendix>
<appendix>Use V key to increase speed.</appendix>
<appendix>* E+V+IKJL: High-speed movement.</appendix>
<appendix>* E+V+R+IKJL: High-speed scroll wheel.</appendix>
<appendix></appendix>
<appendix>Click by:</appendix>
<appendix>* E+Q: Left click.</appendix>
<appendix>* E+2: Middle click.</appendix>
<appendix>* E+W: Right click.</appendix>
<appendix></appendix>
<appendix>Warp cursor position:</appendix>
<appendix>* E+H: Move mouse cursor to the center of the frontmost app's window.</appendix>
<identifier>remap.tbemu.mouse_keys_mode_2</identifier>
<!-- I don't understand why this works with Colemak on ¯\_(ツ)_/¯ -->
<autogen>
__KeyOverlaidModifier__
KeyCode::E, ModifierFlag::NONE,
@begin
KeyCode::VK_CONFIG_SYNC_KEYDOWNUP_notsave_tb_mouse_keys_mode_2,
@end
@begin
KeyCode::E,
@end
</autogen>
</item>
</item>
<item>
<name>TextBlade keyboard</name>
<appendix>This section applies only to the actual TextBlade</appendix>
<item>
<name>TB Layout</name>
<appendix>Select the current layout</appendix>
<item>
<name>QWERTY</name>
<identifier vk_config="true">option.tbk.qwerty</identifier>
</item>
<item>
<name>Colemak</name>
<identifier vk_config="true">option.tbk_colemak</identifier>
</item>
</item>
<item>
<device_only>DeviceVendor::WT</device_only>
<name>Mouse Keys</name>
<appendix>You can move mouse pointer by e+ikjl keys, and scroll by e+r+ikjl keys.</appendix>
<appendix>For Colemak the keys involved are QWFP</appendix>
<appendix></appendix>
<appendix>Usage:</appendix>
<appendix></appendix>
<appendix>Move pointer by:</appendix>
<appendix><![CDATA[ * Left: E down -> J down -> J up ]]></appendix>
<appendix><![CDATA[ * Down: E down -> K down -> K up ]]></appendix>
<appendix><![CDATA[ * Up: E down -> I down -> I up ]]></appendix>
<appendix><![CDATA[ * Right: E down -> K down -> K up ]]></appendix>
<appendix></appendix>
<appendix>The ikjl keys also act as mouse keys when you hold d+ikjl keys down.</appendix>
<appendix>(You can adjust timeout by "__BlockUntilKeyUp__ Timeout" in "Key Repeat" tab.</appendix>
<appendix></appendix>
<appendix>Use R key to enable scroll.</appendix>
<appendix>* E+R+IKJL: Scroll wheel.</appendix>
<appendix></appendix>
<appendix>Use V key to increase speed.</appendix>
<appendix>* E+V+IKJL: High-speed movement.</appendix>
<appendix>* E+V+R+IKJL: High-speed scroll wheel.</appendix>
<appendix></appendix>
<appendix>Click by:</appendix>
<appendix>* E+Q: Left click.</appendix>
<appendix>* E+2: Middle click.</appendix>
<appendix>* E+W: Right click.</appendix>
<appendix></appendix>
<appendix>Warp cursor position:</appendix>
<appendix>* E+H: Move mouse cursor to the center of the frontmost app's window.</appendix>
<identifier>remap.tbk.mouse_keys_mode_2</identifier>
<block>
<config_not>option.tbk_colemak</config_not>
<autogen>
__KeyOverlaidModifier__
KeyCode::E, ModifierFlag::NONE,
@begin
KeyCode::VK_CONFIG_SYNC_KEYDOWNUP_notsave_tb_mouse_keys_mode_2,
@end
@begin
KeyCode::E,
@end
</autogen>
</block>
<block>
<config_only>option.tbk_colemak</config_only>
<autogen>
__KeyOverlaidModifier__
KeyCode::F, ModifierFlag::NONE,
@begin
KeyCode::VK_CONFIG_SYNC_KEYDOWNUP_notsave_tb_mouse_keys_mode_colemak,
@end
@begin
KeyCode::F,
@end
</autogen>
</block>
</item>
<item>
<device_only>DeviceVendor::WT</device_only>
<name>Brightness</name>
<appendix>Map F14 and F15 to brightness down/up</appendix>
<appendix>This is actually the default but it is a good example</appendix>
<identifier>textblade-brightness</identifier>
<autogen>__KeyToKey__ KeyCode::F14, ConsumerKeyCode::BRIGHTNESS_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::F15, ConsumerKeyCode::BRIGHTNESS_UP</autogen>
</item>
<item>
<device_only>DeviceVendor::WT</device_only>
<name>Volume</name>
<appendix>Map F16 and F17 to volume down/up</appendix>
<identifier>textblade-volume</identifier>
<autogen>__KeyToKey__ KeyCode::F16, ConsumerKeyCode::VOLUME_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::F17, ConsumerKeyCode::VOLUME_UP</autogen>
</item>
<item>
<device_only>DeviceVendor::WT</device_only>
<name>Mute</name>
<appendix>Map F18 to mute</appendix>
<identifier>textblade-mute</identifier>
<autogen>__KeyToKey__ KeyCode::F18, ConsumerKeyCode::VOLUME_MUTE</autogen>
</item>
</item>
<item>
<!-- copied from core.xml -->
<name>Disable the internal keyboard while TB or other external keyboards are connected.</name>
<identifier essential="true">general.disable_internal_keyboard_if_external_keyboard_exsits</identifier>
</item>
<!-- mousekeys implementation -->
<item hidden="true">
<identifier vk_config="true">notsave.tb_mouse_keys_mode_2</identifier>
{{ MOUSE_KEYS_MODE_2_EXTRA }}
<autogen>
__BlockUntilKeyUp__ KeyCode::E
</autogen>
<!-- scroll -->
<block>
<modifier_only>ModifierFlag::MOUSE_KEYS_MODE_2_SCROLL</modifier_only>
<autogen>
__KeyToKey__
KeyCode::J,
KeyCode::VK_MOUSEKEY_SCROLL_LEFT,
</autogen>
<autogen>
__KeyToKey__
KeyCode::K,
KeyCode::VK_MOUSEKEY_SCROLL_DOWN,
</autogen>
<autogen>
__KeyToKey__
KeyCode::I,
KeyCode::VK_MOUSEKEY_SCROLL_UP,
</autogen>
<autogen>
__KeyToKey__
KeyCode::L,
KeyCode::VK_MOUSEKEY_SCROLL_RIGHT,
</autogen>
</block>
<!-- mouse move -->
<autogen>__KeyToKey__ KeyCode::J, KeyCode::VK_MOUSEKEY_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::K, KeyCode::VK_MOUSEKEY_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::I, KeyCode::VK_MOUSEKEY_UP</autogen>
<autogen>__KeyToKey__ KeyCode::L, KeyCode::VK_MOUSEKEY_RIGHT</autogen>
<!-- other -->
<autogen>__KeyToKey__ KeyCode::R, KeyCode::VK_MODIFIER_MOUSE_KEYS_MODE_2_SCROLL</autogen>
<autogen>__KeyToKey__ KeyCode::V, KeyCode::VK_MOUSEKEY_HIGHSPEED</autogen>
<!-- click -->
<autogen>__KeyToKey__ KeyCode::Q, PointingButton::LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::KEY_2, PointingButton::MIDDLE</autogen>
<autogen>__KeyToKey__ KeyCode::W, PointingButton::RIGHT</autogen>
<!-- warp cursor position -->
<autogen>__KeyToKey__ KeyCode::H, KeyCode::VK_OPEN_URL_SHELL_warp_mouse_cursor_position_front_window_center</autogen>
</item>
<item hidden="true">
<identifier vk_config="true">notsave.tb_mouse_keys_mode_colemak</identifier>
{{ MOUSE_KEYS_MODE_2_EXTRA }}
<autogen>
__BlockUntilKeyUp__ KeyCode::F
</autogen>
<!-- scroll -->
<block>
<modifier_only>ModifierFlag::MOUSE_KEYS_MODE_2_SCROLL</modifier_only>
<autogen>
__KeyToKey__
KeyCode::N,
KeyCode::VK_MOUSEKEY_SCROLL_LEFT,
</autogen>
<autogen>
__KeyToKey__
KeyCode::E,
KeyCode::VK_MOUSEKEY_SCROLL_DOWN,
</autogen>
<autogen>
__KeyToKey__
KeyCode::U,
KeyCode::VK_MOUSEKEY_SCROLL_UP,
</autogen>
<autogen>
__KeyToKey__
KeyCode::I,
KeyCode::VK_MOUSEKEY_SCROLL_RIGHT,
</autogen>
</block>
<!-- mouse move -->
<autogen>__KeyToKey__ KeyCode::N, KeyCode::VK_MOUSEKEY_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::E, KeyCode::VK_MOUSEKEY_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::U, KeyCode::VK_MOUSEKEY_UP</autogen>
<autogen>__KeyToKey__ KeyCode::I, KeyCode::VK_MOUSEKEY_RIGHT</autogen>
<!-- other -->
<autogen>__KeyToKey__ KeyCode::P, KeyCode::VK_MODIFIER_MOUSE_KEYS_MODE_2_SCROLL</autogen>
<autogen>__KeyToKey__ KeyCode::V, KeyCode::VK_MOUSEKEY_HIGHSPEED</autogen>
<!-- click -->
<autogen>__KeyToKey__ KeyCode::Q, PointingButton::LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, PointingButton::MIDDLE</autogen>
<autogen>__KeyToKey__ KeyCode::W, PointingButton::RIGHT</autogen>
<!-- warp cursor position -->
<autogen>__KeyToKey__ KeyCode::H, KeyCode::VK_OPEN_URL_SHELL_warp_mouse_cursor_position_front_window_center</autogen>
</item>
<item>
<name>Cmd-Option-tab to Cmd+`</name>
<identifier>remap.cmd_opt_tab_to_backquote</identifier>
<autogen>
__KeyToKey__
KeyCode::TAB, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND | MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION | ModifierFlag::NONE,
KeyCode::BACKQUOTE, ModifierFlag::COMMAND_L
</autogen>
<autogen>
__KeyToKey__
KeyCode::TAB, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND | MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION | MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_SHIFT | ModifierFlag::NONE,
KeyCode::BACKQUOTE, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L
</autogen>
</item>
<item>
<name>------ Below are the standard Karabiner settings ------</name>
</item>
</root>
@orand
Copy link

orand commented Mar 24, 2015

It seems the spacebar behavior can be improved by using BlockUntilKeyUp or HoldingKeyToKey, but the syntax is confusing enough that it's not obvious to me how to use it here.

More details here: pqrs-org/Karabiner-archived#229

@wmertens
Copy link
Author

@orand I'll play with those when it starts to annoy me, in the mean time if you find anything let me know 😄

@wmertens
Copy link
Author

@orand BlockUntilKeyUp did the job swimmingly as far as I can tell. Easy to set up too. Thanks for the pointer!

@orand
Copy link

orand commented Mar 25, 2015

@wmertens, I just tried it, that's a major improvement! Thanks so much!

@wmertens
Copy link
Author

@orand now the next annoying thing is shift+green, which requires pressing shift after pressing the spacebar. Hmmm. I'm really looking forward to my textblade 😄.

@evillemez
Copy link

Very cool, thanks for this!

@wmertens
Copy link
Author

Latest update is smarter about a few things and supports Colemak. Simply use the OS X Colemak layout and turn on the appropriate option in the config.

@wmertens
Copy link
Author

@orand btw I fixed shift+green :)

@PostArchitekt
Copy link

I'm having a problem understanding a one thing. I was going to post over at TextBlade forum but I'm still waiting on there approval so I thought I'd ask here instead. I seem to have a problem with the colon/semicolon. It's producing just a p or P with green engaged. Any ideas?

@danshev
Copy link

danshev commented Apr 4, 2016

Am I missing something? I'm holding down the spacebar, typing, and nothing special is happening. Karabiner is installed, the option is enabled, and the other settings seem to work... ?

@wmertens
Copy link
Author

wmertens commented Apr 4, 2016

@orand @evillemez I made a new version that works with the internal keyboard and the TB simultaneously.

@architek1 sorry I missed your comment, I'll check my filters. I changed the way it works, can you try again? Make sure you enable the qwerty option though.

@danshev not sure, can you try with the new version? It also helps to look at the EventViewer app (under the Misc tab in Karabiner)

@danshev
Copy link

danshev commented Apr 4, 2016

@wmertens -- new version is the current Gist, ya?

Using a late 2015 MBP and everything works except for the "Green Layer" options ... anyone else seeing this?

@wmertens
Copy link
Author

wmertens commented Apr 6, 2016

Update: Added an option to use cmd+option+tab for switching between windows.

@danshev: it works on my late MBP… can you look at eventviewer to see what the key events are when you type space+d?

@danshev
Copy link

danshev commented Apr 9, 2016

Settings enabled:

  • QWERTY
  • Enable me
  • Activate Green Layer by spacebar

With the above enabled, when I tap (press and release) the spacebar, I receive KeyDown and KeyUp events (code 0x31) ... when I hold the spacebar down, nothing registers. Holding the spacebar down and then pressing "d", the UI output I get is just a d ... EventViewer-wise, I get:

eventType:KeyDown code:0x2 name:d flags: misc:KeyCode::D characters:d
eventType:KeyUp code:0x2 name:d flags: misc:KeyCode::D characters:d

So, to be clear, the above is all I get from EventViewer if I hold down the spacebar and press d (i.e. space+d).

@wmertens
Copy link
Author

@danshev aha, the green layer was in the selection definitions. I moved it into the Enable Me section, so it should work now.

I highly recommend using the edit/select mode though, having a cursor on home row is great!

@danshev
Copy link

danshev commented Apr 12, 2016

Great stuff, thank you! I hadn't enabled the Edit/Select mode because I didn't understand what it was ... taking things one step at a time :)

In fact, I still don't really understand what Edit/Select mode does (?).

@wmertens
Copy link
Author

wmertens commented Apr 17, 2016

@danshev actually I managed to break things by doing this, need to fix it. Until I do, better to use the previous revision at https://gist.github.com/wmertens/e3541192f1a769eda908/b3cb84a39c7123490d79c351d258b5518b51c3ff.

The edit/select layer is basically for cursor movements without taking your hands off home row. See the video at https://waytools.com/tech/1/home-row-cursor

@pattieja1
Copy link

Hi, I've been following the WayTools forums, just never joined, and started using Karabiner based on this thread. https://forum.waytools.com/t/emulating-textblade-on-os-x/298/27.

Thanks for putting that together as I feel I'll be able to hit the ground running when I eventually get my TextBlade.

I think I got the CMD, CTRL, OPT shortcuts figured out using Z X C V combos. I forked this gist and added the changes. The only issues I've seen using EventViewer is that sometimes it doesn't want to generate CTRL + OPT when pressing Z+X+C, but instead sends a Z + OPT sequence.

@wmertens
Copy link
Author

wmertens commented May 7, 2016

@pattieja1 cool, thanks for that! I'll try it out and add them here. I've gotten really used to the combos on the TextBlade.

Sadly, it turns out that github doesn't send email when a gist gets a comment, so I need to remember to check here every so often.

@wmertens
Copy link
Author

I finally got around to updating the gist, now it has the modifiers from @pattieja1 (right side as well) and window switching shortcuts.

@pattieja1
Copy link

Thanks for integrating my changes but now Green-semi is spitting out ' not ). I'm going to revert back to my version since a quick look/hack on the private.xml isn't fixing it.

@pattieja1
Copy link

Unfortunately, no matter what I've done (going back to previous versions of the config, updating Karabiner, rebooting) I can't get ) to come out on the green layer on my work laptop. My personal laptop at home works fine with the new version, which is very weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment