4

I'm stuck to hold a specific character. The code does work with letters but doesn't work with apostrophe.

'::
{
pressed:=!pressed
if(pressed)
{
    sendinput,{' down}
}
else
{
    sendinput,{' up}
}
}
return

Does anyone have idea why this isn't working?

phuclv
  • 27,773

1 Answers1

0

This might happen because you send apostrophe and you use apostrophe as the hotkey. Here is special syntax to avoid the recursive Send command:
https://www.autohotkey.com/docs/Hotkeys.htm#prefixdollar

So you can use the same key but then need to prefix the hotkey with dollar sign $.

This will work:

$'::
    send {' down}
    send {' up}
return

But this will not work:

'::
    send {' down}
    send {' up}
return
Mikhail V
  • 1,003