How to bind a key to press two separate keys
To make this work you have to use a third party tool: Karabiner.


Download, install and open Karabiner
Open in the menulet Karabiner -> Preferences
Open the tab Misc &amp; Uninstall
Hit the button Open private.xml
Open the file private.xml with an appropriate editor
Enter the customized keycode

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
    &lt;item&gt;
        &lt;name&gt;X to A and B&lt;/name&gt;
        &lt;appendix&gt;When you type X, A and B are written&lt;/appendix&gt;
        &lt;identifier&gt;x2ab&lt;/identifier&gt;
        &lt;autogen&gt;__KeyToKey__ KeyCode::X, KeyCode::A, KeyCode::B&lt;/autogen&gt;
    &lt;/item&gt;
&lt;/root&gt;

Save the file
Open in the menulet Karabiner -> Preferences the tab Change Key
Hit the ReloadXML button
Enable the remapping. It should be listed at the beginning.


You can restrict the keybinding to particular apps if needed by adding additional tags. Leave a comment if you want to know how or specify your question.