How to type 5 shift keys in a row? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
doncole
Posts: 37
Joined: 04 Jun 2017, 17:39

How to type 5 shift keys in a row?

12 May 2019, 08:42

How to type 5 shift keys in a row?

Don Cole


[Mod note: Added topic name]
swagfag
Posts: 3924
Joined: 11 Jan 2017, 17:59

Re:

12 May 2019, 08:57

Code: Select all

Send {Shift 5}
doncole
Posts: 37
Joined: 04 Jun 2017, 17:39

Re: Re:

15 May 2019, 17:52

swagfag wrote:
12 May 2019, 08:57

Code: Select all

Send {Shift 5}

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;;;; Windows Alt ;;;;;;;;;;;;;;;;;;;;;;;;;
!w::
Send, _Windows 10
return
^F9::   ;;;;;;;;;;;;;;;;;;;;; ppause() ;;;;;;;;;;;;;;;;;;;;;;;;;
send, ppause("")
return
F6::    ;;;;;;;;;;;;;;;;;;;;; Sticky Key ;;;;;;;;;;;;;;;;;;;;;;;
Send, {SHIFT 5}
Return 
Windows Alt works.
ppause() works.
Sticky Keys dosn't work.
nothing happens when I press F6.
I also I tried !F6.
Still bothing happens.

As you probably know:
!=Alt
^=Ctl
Mod edit: Fixed Formatting
doncole
Posts: 37
Joined: 04 Jun 2017, 17:39

Re: How to type 5 shift keys in a row?

16 May 2019, 00:39

['QUOIe
7/ ASDXf ;;;;;;;;;;;;;;;;;;;;;;;;;; Windows Alt ;;;;;;;;;;;;;;;;;;;;;;;;;
!w::
Send, Windows 10
return
F6:: ;;;;;;;;;;;;;;;;;;;;;; Sticky Keys ;;;;;;;;;;;;;;;;;;;;;;;
Send, {SHIFT 5}
Return

Windows Alt works
Sticky Keys dosn't
Nothing happens
Same with !F6
As you problem know:
!=Alt
^=Ctl
gregster
Posts: 4652
Joined: 30 Sep 2013, 06:48

Re: How to type 5 shift keys in a row?

17 May 2019, 03:59

Perhaps something like this?

Code: Select all

F6::			; Press F6 to activate
Send, {Shift Down}
Input, string, L5 V		; you could add an endkey, see 'Input' docs
Send, {Shift Up}		
return
doncole
Posts: 37
Joined: 04 Jun 2017, 17:39

Re: How to type 5 shift keys in a row?

18 May 2019, 06:18

Thank you gregster, :D :D :D

I tried your code and still get nothing after hitting F6.
I don't hear any beeps either.
Shouldn't I hear 5 beeps?

Don Cole
gregster
Posts: 4652
Joined: 30 Sep 2013, 06:48

Re: How to type 5 shift keys in a row?

18 May 2019, 11:17

No, why beeps? Do you usually hear beeps when you use shift?
What do you expect to happen?

With this script, you hit F6 and then the next five characters you type, will be shifted (as long as you don't press shift yourself).
Just 5 shift keys in a row will be sent with this: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=64473&p=277465#p276582
If that's not what you want, please elaborate... we could do beeps with Soundbeep.
If the receiving app runs with elevated rights, run your script as admin.

If that's for a game, it might be more complicated, but then I am probably the wrong guy to help you.
Perhaps this helps then: How to Make AHK Work in Most Games - The Basics
swagfag
Posts: 3924
Joined: 11 Jan 2017, 17:59

Re: How to type 5 shift keys in a row?

18 May 2019, 16:29

the question evidently wasnt "how to type 5 shift keys in a row?"
rather, it was "how to switch sticky keys on?"
and the answer to that is: "not by typing 5 shift keys in a row"

Code: Select all

1::toggleStickyKeys(1)
2::toggleStickyKeys(0)

toggleStickyKeys(enableStickyKeys := true) {
	static SPI_GETSTICKYKEYS := 0x003A
		 , SPI_SETSTICKYKEYS := 0x003B
		 , SIZE_STICKYKEYS := 8
		 , SKF_STICKYKEYSON := 0x00000001
		 , SPIF_UPDATEINIFILE := 0x0001
		 , SPIF_SENDCHANGE := 0x0002

	VarSetCapacity(SK, SIZE_STICKYKEYS, 0)
	NumPut(SIZE_STICKYKEYS, &SK, 0, "UInt")

	DllCall("SystemParametersInfo", "UInt", SPI_GETSTICKYKEYS, "UInt", SIZE_STICKYKEYS, "Ptr", &SK, "UInt", 0)

	dwFlags := NumGet(&SK, 4, "UInt")

	if enableStickyKeys
		dwFlags |= SKF_STICKYKEYSON
	else
		dwFlags &= ~SKF_STICKYKEYSON

	NumPut(dwFlags, &SK, 4, "UInt")

	DllCall("SystemParametersInfo", "UInt", SPI_SETSTICKYKEYS, "UInt", SIZE_STICKYKEYS, "Ptr", &SK, "UInt", SPIF_UPDATEINIFILE | SPIF_SENDCHANGE)
}
doncole
Posts: 37
Joined: 04 Jun 2017, 17:39

Re: How to type 5 shift keys in a row?

21 May 2019, 00:32

Thank you swagfag :D :D :D

That's what I was looking for.

I did word my question wrong.
It does work btw.

Don Cole
doncole
Posts: 37
Joined: 04 Jun 2017, 17:39

Re: How to type 5 shift keys in a row?

27 May 2019, 08:38

I want to thank you again awaghag, :bravo:
That code saved me a lot of time.
I got tired of pushing the shift key 5 times.

BTW how do I mark a thread as solved?
gregster
Posts: 4652
Joined: 30 Sep 2013, 06:48

Re: How to type 5 shift keys in a row?  Topic is solved

27 May 2019, 08:42

doncole wrote:
27 May 2019, 08:38
BTW how do I mark a thread as solved?
Click the green check mark of the post you want to mark (right side).
gregster
Posts: 4652
Joined: 30 Sep 2013, 06:48

Re: How to type 5 shift keys in a row?

27 May 2019, 09:47

Didn't you want to mark one of swagfag's (topic-related) posts instead of mine?
Each post has a check mark... I think, by clicking it a second time, you can unmark a post again and select another one.

Return to “Ask For Help”

Who is online

Users browsing this forum: A_AhkUser, Bing [Bot], boiler, enrica, Google [Bot], keedooh and 44 guests