I make extensive use of the character "Zero-width non-joiner" in my documents and the program I use to write my documents is InDeisng.

In InDesign the shortcut for ZWNJ is CTRL+SHIFT+2.

Now I would like to use AutoHotKey to press Left_CTRL+SPACE and AutoHotKey sends CTRL+SHIFT+2 to InDesign.

I've read this page Remapping Keys (Keyboard, Mouse and Joystick), but sadly it works for single key mapping.

The following code doesn't work

LCtrl & space::LCtrl & LShift & 2

I've tried also the following code, but this doesn't work either

LCtrl & space:: send LCtrl & LShift & 2

up vote 0 down vote accepted

If you look at the Hotkeys Doc on their website, it shows that the less than and greater than signs can be used to specify left or right of keypairs. The Send Doc details how to send key combinations including shift and control. This means that the following should be what you are looking for:

<^Space::
Send ^+2
Return

You can just input this character I suppose, no need to emulate the shortcut. ZWNJ is a unicode character, its code is 200c. So try this:

<^space::
    send {U+200c}
return

Note that this will bind a system-wide shortcut, so it should work in most editors.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.