how to give a combnation of order through single time pressing keysz

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shekhar Singh
Posts: 115
Joined: 06 Dec 2022, 02:35

how to give a combnation of order through single time pressing keysz

Post by Shekhar Singh » 07 Dec 2022, 18:34

I use sleep function when i have to give combination of orders (one after another) through ahk.

is there any other way of doing this .

I have heard that combination of square brackets {} can be used to give series of orders can someone guide me on this .


[Mod action: Topic moved from "Other Utilities and Resources". Please pay attention to where you post new threads.]

User avatar
boiler
Posts: 17065
Joined: 21 Dec 2014, 02:44

Re: how to give a combnation of order through single time pressing keysz

Post by boiler » 07 Dec 2022, 19:00

That is not true. People erroneously place {Sleep ...} inside of { }, but it does not work that way. Just put a Sleep on its own line between Send lines.

User avatar
mikeyww
Posts: 27082
Joined: 09 Sep 2014, 18:38

Re: how to give a combnation of order through single time pressing keysz

Post by mikeyww » 07 Dec 2022, 19:21

I agree overall. It turns out that Sleep is a key name that can be sent using Send.

In any case, as boiler mentioned, this is not a command in braces, but a key name.

Explained: Key names

Code: Select all

F3::
Send x
Send {Sleep 100}
Send y
Return

User avatar
boiler
Posts: 17065
Joined: 21 Dec 2014, 02:44

Re: how to give a combnation of order through single time pressing keysz

Post by boiler » 07 Dec 2022, 20:15

Isn't that key meant to represent keyboard keys that are meant to put your computer in sleep mode (as opposed to executing a Sleep-type delay)?

Image


So when you send {Sleep 1000} it perhaps has a similar effect as the sleep command just because it "wastes time" sending a bunch of non-keypresses (if your machine doesn't recognize it), but isn't really meant to be an alternative to the Sleep command. The documentation doesn't say much or anything on this from what I can tell, though.

And for machines where the actual Sleep key is implemented, I wonder what effect sending it 1000 times in succession might have on your Windows session. Would it toggle it in and out of sleep mode 500 times?

User avatar
mikeyww
Posts: 27082
Joined: 09 Sep 2014, 18:38

Re: how to give a combnation of order through single time pressing keysz

Post by mikeyww » 07 Dec 2022, 20:23

No idea! I'm curious about the answers. I could reverse Fn and try it.

User avatar
boiler
Posts: 17065
Joined: 21 Dec 2014, 02:44

Re: how to give a combnation of order through single time pressing keysz

Post by boiler » 07 Dec 2022, 20:31

According to this How-to Geek article where I got the above picture:
Most Windows PCs and tablets include a special sleep button somewhere on the body of the device. To find it, consult your device’s documentation, or look for a keyboard key with a small “Z” or moon icon on it. If you push it, your PC will fall asleep instantly. To wake it up again later, just press the power button, tap the trackpad, or press a keyboard key.
I would hesitate to send that if that's what the Sleep key is, unless your intention is to put your machine into sleep mode, of course.

User avatar
mikeyww
Posts: 27082
Joined: 09 Sep 2014, 18:38

Re: how to give a combnation of order through single time pressing keysz

Post by mikeyww » 07 Dec 2022, 20:52

OK. I guess it should work, and my script was poorly designed! My keyboard has no such key. I think I've seen them on HPs.

Post Reply

Return to “Ask for Help (v1)”