Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is the code I have :

Send [
Input, Char, T2 L1
if Char = a
    Send â
Send %Char%

When I type [ then a, it has a normal behaviour and produces â. But, when I type [ then p, the character [ is not printed. The problem is the second line (Send [) in which [ is the character being remapped.

I tried the following without success :

  • Send `[

  • Send {[}

I want to print [ even if it is being remapped.

share|improve this question
up vote 2 down vote accepted

Use $ as a modifier before the hotkey, i.e. $[::.

As the AHK documentation states:

This is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself. The exact behavior of the $ prefix varies depending on operating system:

On Windows NT4/2k/XP or later: The $ prefix forces the keyboard hook to be used to implement this hotkey, which as a side-effect prevents the Send command from triggering it. The $ prefix is equivalent to having specified #UseHook somewhere above the definition of this hotkey.

On Windows 95/98/Me: The hotkey is disabled during the execution of its thread and re-enabled afterward. As a side-effect, if #MaxThreadsPerHotkey is set higher than 1, it will behave as though set to 1 for such hotkeys.

share|improve this answer
@Gradient You can use the Hotkey command, as in Hotkey +] Off before the Send followed by Hotkey +] On after the Send. That should always work. – Bob Sep 7 '12 at 3:50
I deleted my question. For future readers, I said that this answer solved the question I asked, but not if I need to do this : +]:: ; Send }. I found out that I simply needed to encase this curly bracket inside curly brackets, like this : {}}. – Gradient Sep 7 '12 at 4:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .