Controlsend/click help.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Zantomato
Posts: 9
Joined: 25 Nov 2018, 13:01

Controlsend/click help.

20 Jan 2019, 11:36

Hello, I can't seem to find much about it, so i'm hoping someone can help, or simply tell me if it's not possible.

I'm using controlclick in a old-school retro game, and it works just fine. Kinda.

However, while I'm playing the game, and the script is running in the backround, If I'm holding down CTRL (or any modifier..) It will also apply to the controlclick/send that's running in the background.

For example, here's a code example.

ControlSend,, {F2}, ahk_exe client.exe

And i'm pressing/holding CTRL, it will send CTRL+F2.

The same thing happens with Controlclick aswell. :(

I don't want this to happen, is where a workaround?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Controlsend/click help.

20 Jan 2019, 13:10

You could try this or similar (i.e. try Ctrl / RCtrl):
ControlSend,, {LCtrl up}{F2}, ahk_exe client.exe
Or use KeyWait with LCtrl.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Zantomato
Posts: 9
Joined: 25 Nov 2018, 13:01

Re: Controlsend/click help.

21 Jan 2019, 01:18

Alright, not quite the solution I was hoping for, but it does somewhat help, thank you.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Controlsend/click help.

27 Jan 2019, 14:53

- You could experiment with blocking the Ctrl key, e.g. *Ctrl to block any key combinations containing Ctrl, and to block Ctrl itself. You could then try manually adding in any Ctrl hotkeys that you need to use.
- [EDIT:] Actually it doesn't seem to matter what you do with hotkeys, windows detect when Ctrl is held down.

- This is an important problem, in case anyone has any ideas.
- [EDIT:] This script demonstrates a key problem.

Code: Select all

;note: without KeyWait,
;Ctrl is usually still being held down by the user,
;when the PostMessage is sent,
;this results in the folder (one level up)
;being opened in a *new* window,
;instead of in the current window

^u:: ;explorer (folders) - move up one folder
ToolTip, % "release Ctrl key"
KeyWait, Ctrl
ToolTip
PostMessage, 0x111, 40994,, ShellTabWindowClass1, A ;WM_COMMAND := 0x111 ;Up one level
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 325 guests