geekhack

geekhack Community => Keyboards => Topic started by: canthonytucci on Fri, 13 January 2012, 08:09:53

Title: HHKB Style Cursor Movment w/ KeyRemapForMacbook
Post by: canthonytucci on Fri, 13 January 2012, 08:09:53
Hello all!

I've been using a KBC Poker at work for the past week and since wednesday a HHKB at home, I really like the "right-side-of-the-board" approach to cursor movement that the HHKB uses as opposed to the FN+WASD on the poker. I have not been using these mini boards very long. On the poker, using two hands (and primarily the oposite one that I am used to) to operate the arrow keys has proven hard, not to mention that one needs to move both away from the home row as opposed to just one with a normal arrow key setup.  It is with this in mind I decided to see if I could re-produce the HHKB functions using KeyRemapForMacbook

For those who are not familiar with the program, KeyRemapForMacbook is a preference pane for OS X that allows users to remap keys as the name implies. I guess this is like Autohotkey for windows, but I do not know as I have never used Autohotkey, from the description it sounds similar, if not more powerful than KeyRemap. It comes with many useful pre-written items (Including some awesome global Vi and EMACS bindings), but also allows you to create your own mappings by editing an XML document.

It's free, and available here (http://pqrs.org/macosx/keyremap4macbook/index.html), instructions for how to form the XML document are there, but sort of annoying to find (here's a direct link (http://pqrs.org/macosx/keyremap4macbook/xml.html)).

Anyway, I thought that maybe others would like to try this out, so here's the code. There's one set up for Right-Shift as the modifier, and one for Right-Control, there's a reference at the above link to all the other key codes if you'd like to use a different one. So far I think I am liking the right-control better (as the size of the key on the poker is similar to HHKB FN, and it is slightly easier to hold down, also, from time to time I use my Right Shift Key), however, the right shift is closer to the actual position of the FN key on the HHKB, so YMMV.


[ATTACH=CONFIG]37391[/ATTACH]
Code: [Select]
<?xml version=&quot;1.0&quot;?>
<root>
    <item>
        <name>Right Control + [/;/'// for Arrow Keys (HHKB STYLE)</name>
        <identifier>private.r_control_hhkb_style_arrows</identifier>
        <autogen>--KeyToKey--
            KeyCode::SEMICOLON, ModifierFlag::CONTROL_R,
            KeyCode::CURSOR_LEFT
        </autogen>
        <autogen>--KeyToKey--
            KeyCode::QUOTE, ModifierFlag::CONTROL_R,
            KeyCode::CURSOR_RIGHT
        </autogen>
        <autogen>--KeyToKey--
            KeyCode::BRACKET_LEFT, ModifierFlag::CONTROL_R,
            KeyCode::CURSOR_UP
        </autogen>
        <autogen>--KeyToKey--
            KeyCode::SLASH, ModifierFlag::CONTROL_R,
            KeyCode::CURSOR_DOWN
        </autogen>
    </item>


    <item>
        <name>Right Shift + [/;/'// for Arrow Keys (HHKB STYLE)</name>
        <identifier>private.r_shift_hhkb_style_arrows</identifier>
        <autogen>--KeyToKey--
            KeyCode::SEMICOLON, ModifierFlag::SHIFT_R,
            KeyCode::CURSOR_LEFT
        </autogen>
        <autogen>--KeyToKey--
            KeyCode::QUOTE, ModifierFlag::SHIFT_R,
            KeyCode::CURSOR_RIGHT
        </autogen>
        <autogen>--KeyToKey--
            KeyCode::BRACKET_LEFT, ModifierFlag::SHIFT_R,
            KeyCode::CURSOR_UP
        </autogen>
        <autogen>--KeyToKey--
            KeyCode::SLASH, ModifierFlag::SHIFT_R,
            KeyCode::CURSOR_DOWN
        </autogen>
    </item>
</root>

Cheers!