Page 1 of 1

Script only works sometimes

Posted: 21 Feb 2018, 18:31
by Slimey
I wrote a simple script (and have tried a few variations of it as well).

Code: Select all

!7::
    Send,\
Return
!+7::
    Send,|
Return
Right Alt + Right Shift + 7 = Does nothing
Left Alt + Left Shift + 7 = Works
Right Alt + Right Shift + 7 = Now works a few times

Advice?

Re: Script only works sometimes

Posted: 21 Feb 2018, 22:08
by RunarSF
I'm guessing your right alt key is an AltGr key, if that is the case, this code should work. More info on hotkeys can be found in the documentation.

Code: Select all

#SingleInstance, Force
<^>!+7::SendRaw, |
!+7::SendRaw, |
<^>!7::SendRaw, \
!7::SendRaw, \

Re: Script only works sometimes

Posted: 22 Feb 2018, 13:38
by Slimey
RunarSF wrote:I'm guessing your right alt key is an AltGr key, if that is the case, this code should work. More info on hotkeys can be found in the documentation.

Code: Select all

#SingleInstance, Force
<^>!+7::SendRaw, |
!+7::SendRaw, |
<^>!7::SendRaw, \
!7::SendRaw, \
Holy crap, that worked! I LOVE YOU <3

But the weird thing is that its not an AltGr key and I tried the AlrGr syntax before... Maybe it was the Returns that messed it up?

Re: Script only works sometimes

Posted: 22 Feb 2018, 17:54
by RunarSF
Slimey wrote:
RunarSF wrote:I'm guessing your right alt key is an AltGr key, if that is the case, this code should work. More info on hotkeys can be found in the documentation.

Code: Select all

#SingleInstance, Force
<^>!+7::SendRaw, |
!+7::SendRaw, |
<^>!7::SendRaw, \
!7::SendRaw, \
Holy crap, that worked! I LOVE YOU <3

But the weird thing is that its not an AltGr key and I tried the AlrGr syntax before... Maybe it was the Returns that messed it up?
I just shortened your code down a bit, since you only have one thing the hotkeys do, you can have them on the same line without the return, so that wouldn't have been your problem. It's most likely that AHK wanted you to define the actual right alt key, and not just alt, I did stumble upon some weird errors there too though, so I'm not really sure. Really happy to hear it worked out in the end though! Happy to help :)
(Could you click the Set topic as solved button on the post with the script? Thanks.)