Can i put shift into a hotstring? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
foxrain

Can i put shift into a hotstring?

18 Mar 2018, 18:49

Hello,
i need a script to do this. When i press {shift down}{shiftup}{a down}{a up} then it makes c pressed for 3 seconds. I've tried many ways and im thinking of using hotstring. Can i make a hotstring like that?
:*B0:{shift}a::
send, {c up}
sleep, 3000
send, {c down}
return
the problem is "{shift}" in string name. it does not work like that. The same for :*B0:+a::
Do u have any ideas for my script? Thanks in advance.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Can i put shift into a hotstring?

18 Mar 2018, 23:15

Shift is not a valid key for hotstrings. I wonder what alternatives people use.
I am your average ahk newbie. Just.. a tat more cute. ;)
Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Can i put shift into a hotstring?

19 Mar 2018, 01:48

Hallo,
try:

Code: Select all

~Shift::
Input, Key, VL1T1
If (Key == "a")
{
	send, {BS}{c Down}
	sleep, 3000
	send, {c Up}
}
Return
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Can i put shift into a hotstring?

19 Mar 2018, 01:52

Rohwedder wrote:Hallo,
try:

Code: Select all

~Shift::
Input, Key, VL1T1
If (Key == "a")
{
	send, {BS}{c Down}
	sleep, 3000
	send, {c Up}
}
Return
What if you had to press 'a' a second later?
I am your average ahk newbie. Just.. a tat more cute. ;)
Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Can i put shift into a hotstring?

19 Mar 2018, 01:56

Hallo,
if you want, do it with T2 or T3 or without T...
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Can i put shift into a hotstring?

19 Mar 2018, 03:52

Why not the most simple:

Code: Select all

+a::
; Some action
Return

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Can i put shift into a hotstring?

19 Mar 2018, 04:35

Delta Pythagorean wrote:Why not the most simple:

Code: Select all

+a::
; Some action
Return
Because that's a hotkey not a hotstring. :wtf:
I am your average ahk newbie. Just.. a tat more cute. ;)
Guest

Re: Can i put shift into a hotstring?

19 Mar 2018, 08:13

C: Case sensitive: When you type an abbreviation, it must exactly match the case defined in the script. Use C0 to turn case sensitivity back off.
source https://autohotkey.com/docs/Hotstrings.htm
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Can i put shift into a hotstring?  Topic is solved

19 Mar 2018, 17:57

Why not use this:

Code: Select all

~Shift Up::
KeyWait, a, d t0.75
; Your code
Return
There's no need for a hotstring.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Can i put shift into a hotstring?

20 Mar 2018, 10:09

Hallo Delta Pythagorean:
Because it does not work.
Every time after any capital letter is written, your Hotkey fires!
Guest

Re: Can i put shift into a hotstring?

20 Mar 2018, 11:12

repeating post above because nobody read it probably
Guest wrote:
C: Case sensitive: When you type an abbreviation, it must exactly match the case defined in the script. Use C0 to turn case sensitivity back off.
source https://autohotkey.com/docs/Hotstrings.htm
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Can i put shift into a hotstring?

20 Mar 2018, 12:15

Guest wrote:repeating post above because nobody read it probably
Guest wrote:
C: Case sensitive: When you type an abbreviation, it must exactly match the case defined in the script. Use C0 to turn case sensitivity back off.
source https://autohotkey.com/docs/Hotstrings.htm
Pal we already discussed that but we were looking at other options. You see the problem with case is that you have to press shift while you're typing the key. But we want it to work when shift is lifted, released, and the key is pressed as well.

But that's a good alternative can't deny.
I am your average ahk newbie. Just.. a tat more cute. ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], sbrady19 and 127 guests