Hi guys,
I have a problem with my script that using ControlSend to sends text in specific window, I made the script to automatically send some messages in specific window. So the problems were that I'm working on other things else so sometimes I'd use special keys as CTRL, Shift and those keys would sometimes interfered with my script, for example : My script are going to send ".halo" for every 15sec, so sometimes it sent ">halo" because on another Windows I'm typing while holding Shift.
Can I prevent special keys from interfering with my scripts (not on top window)?
Thank you in advance.
ControlSend being interrupted by special keys
-
- Posts: 6
- Joined: 18 Aug 2018, 23:48
Re: ControlSend being interrupted by special keys
Hallo,
place before your ControlSend:
place before your ControlSend:
Code: Select all
#InstallKeybdHook
While, A_TimeIdleKeyboard < 300 Or GetKeyState("Shift","P") Or GetKeyState("Alt","P") Or GetKeyState("LWin","P") Or GetKeyState("RWin","P") Or GetKeyState("Ctrl","P")
Sleep, 50
Last edited by Rohwedder on 19 Aug 2018, 01:48, edited 1 time in total.
-
- Posts: 6
- Joined: 18 Aug 2018, 23:48
Re: ControlSend being interrupted by special keys
Could you please explain more about that? I can't get to my computer right now so I'll try it later as soon as possible.
Thank you for reply.
Thank you for reply.
Re: ControlSend being interrupted by special keys
Hallo,
wait until you get to your computer so you can read the autohotkey manual!
wait until you get to your computer so you can read the autohotkey manual!
Re: ControlSend being interrupted by special keys
Rohwedder wrote:Hallo,
wait until you get to your computer so you can read the autohotkey manual!
But he's right, in the documentation you can find (almost) everything.
https://autohotkey.com/docs/AutoHotkey.htm
Read about some functions you want to use.
If you have questions, you can always ask
Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
-
- Posts: 6
- Joined: 18 Aug 2018, 23:48
Re: ControlSend being interrupted by special keys
Mhmm thanks that works, but pause toggle made my script not working normally since im using SetTimer. Pause toggle would make it keep the "keys" and then continued send next text, for example :
the script started just now, and i hold down CTRL for 5 secs after hold up the CTRL,, the script continued send the text for next 10seconds so the script ingored the "Sleep 15000" or meant it's just paused the script from send texts but neglecting the sleep commands.
So if I somehow accidentally hold it for a long times, it would spam my game xP, is there another way?
and thank you very much for the help
Sorry for my bad english.
the script started just now, and i hold down CTRL for 5 secs after hold up the CTRL,, the script continued send the text for next 10seconds so the script ingored the "Sleep 15000" or meant it's just paused the script from send texts but neglecting the sleep commands.
So if I somehow accidentally hold it for a long times, it would spam my game xP, is there another way?
and thank you very much for the help
Sorry for my bad english.
-
- Posts: 6
- Joined: 18 Aug 2018, 23:48
Re: ControlSend being interrupted by special keys
Ah, I think the problem is fixed.. I just removed SetMouseDelay, -1 and SetKeyDelay, -1, -1, .
Tyvm Rohwedar & Scr1pter for refering documentation.
Tyvm Rohwedar & Scr1pter for refering documentation.
Who is online
Users browsing this forum: Anput and 200 guests