hasu wrote:
What kind of util do you use now? AHK script? I'm curious to see your script or configuration.
I am on a Mac, so I have used two preference panes called
KeyRemap4MacBook and
PcKeyboardHack. With your firmware I no longer need PCKeyboardHack, but the KeyRemap4Macbook preference pane has functionality that allows changing the way modifier keys work. It has a built-in mapping for mapping CTRL to CTRL/ESC, and it also allows for user customisation through an XML file.
The mapping of SHIFT keys is as follows:
Code: Select all
<item>
<name>Shifts to Parentheses</name>
<appendix>Shifts, when pressed alone, type parentheses.</appendix>
<appendix>When used with other keys they're normal shifts.</appendix>
<identifier>space_cadet.shifts_to_parens</identifier>
<!-- This is the basic mapping. -->
<autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L</autogen>
<autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_R</autogen>
<!--
Remap the "rolls" of () and )( because it's too easy to hit one
before finishing the other, and there's no other reason to be
pressing both shift keys at once anyway
-->
<autogen>--KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L</autogen>
<autogen>--KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_L, KeyCode::KEY_9, ModifierFlag::SHIFT_L, KeyCode::KEY_0, ModifierFlag::SHIFT_L</autogen>
<!--
Remap Rshift+Space to ') ', because when typing an end paren and
then a space I tend to hit space before I let go of rshift.
-->
<autogen>--KeyToKey-- KeyCode::SPACE, ModifierFlag::SHIFT_R, KeyCode::KEY_0, ModifierFlag::SHIFT_L, KeyCode::SPACE</autogen>
</item>
I also have a mapping that translates the right option key (ALT) key to a combination of modifier keys:
Code: Select all
<item>
<name>Remap Right Option to Hyper</name>
<appendix>OS X doesn't have a Hyper. This maps Right Option to Control + Shift + Option + Command.</appendix>
<identifier>space_cadet.right_option_to_hyper</identifier>
<autogen>--KeyToKey-- KeyCode::F19, KeyCode::COMMAND_L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L</autogen>
</item>
I the snippet above, the translation is from the F19 key. I used to use PCKeyboardHack to map the right option key to F19, but now this is done through the firmware, so I have uninstalled it from my machine. KeyRemap4Macbook I still use, as so far I haven't been able to replicate the functionality with the firmware.
The above mappings were inspired by a
blog post written by Steve Losh.