Toggle related Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Potato

Toggle related

24 Sep 2017, 03:33

Code: [Select all] [Download] (Untitled.ahk)GeSHi © Codebox Plus

F8::
Toggle := !Toggle
While Toggle{
SetScrolllockState AlwaysOn
Click
Sleep 60000
}
SetScrolllockState AlwaysOff
return

So I want Scroll lock to be an indicator of whether my toggled script is being toggled on or off.
This script is working for the first time I toggle it.
Toggle on, off, back on, and then it stays permanently on. need help x:
Potato
Posts: 6
Joined: 24 Sep 2017, 06:24

Re: Toggle related

24 Sep 2017, 06:28

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus


My bad, I did not post the full code. Here is the full code. I tried what you stated but it still had the same issue :/
Potato
Posts: 6
Joined: 24 Sep 2017, 06:24

Re: Toggle related

24 Sep 2017, 08:06

Same thing happened with the scroll lock, but this time the click is gone @.@
HotKeyIt
Posts: 1502
Joined: 29 Sep 2013, 18:35
Contact:

Re: Toggle related

24 Sep 2017, 08:43

I replaced Click with ToolTip so you can see the tooltip is turned on and off.
I don't have ScrollLock led on my keyboard but it works fine with Capslock for me:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Potato
Posts: 6
Joined: 24 Sep 2017, 06:24

Re: Toggle related

24 Sep 2017, 11:18

I tried what you posted, however same issue. After toggling a few times, the led is just permanently on
HotKeyIt
Posts: 1502
Joined: 29 Sep 2013, 18:35
Contact:

Re: Toggle related

24 Sep 2017, 13:36

Try this one, I modified it to accept more than 2 presses and react faster as well as don't run the code when it is about to disable:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Potato
Posts: 6
Joined: 24 Sep 2017, 06:24

Re: Toggle related

25 Sep 2017, 07:23

the last code worked perfectly, thanks alot!
Potato
Posts: 6
Joined: 24 Sep 2017, 06:24

Re: Toggle related

30 Sep 2017, 10:42

HotKeyIt wrote:Try this one, I modified it to accept more than 2 presses and react faster as well as don't run the code when it is about to disable:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Hi, I don't understand the A_Index<=600 and Sleep 100 part, could you explain it to me?
User avatar
KuroiLight
Posts: 183
Joined: 12 Apr 2015, 20:24
GitHub: KuroiLight

Re: Toggle related

30 Sep 2017, 10:50

Don't have to worry about thread/loop interruptions with the following

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Windows 10, Ryzen 1600, 16GB G.Skill DDR4, 8GB RX 480 | [MyScripts][MySublimeSettings] [Unlicense][MIT License]

Return to “Ask For Help”

Who is online

Users browsing this forum: lj87, xsrvmy, Yahoo [Bot] and 50 guests