autohotkey

How to prevent 'control' from being seen when I trigger '^WheelUp'


I have this painting programme, when you hold down control the move tool temporarily becomes the active tool.

I am trying to create two hotkeys that will increase decrease brush size:

#SingleInstance, force
^wheelup::
    tooltip, Ctrl + WheelUp
    ;Sendinput, {[}                     ;Increase brush size
    return
^wheeldown::
    tooltip, Ctrl + Wheeldown
    ;Sendinput, {]}                     ;Reduce brush size
    return

I am using a the tooltip command to demonstrate my issue.

But the programme notices that control key is held/pressed, and so makes the move tool the active tool, thus making it impossible to change the brush size. This recording shows what I mean

I tried applying the $ prefix but the programme still sees control and switches to the move tool:

#SingleInstance, force
$^wheelup::
    tooltip, Ctrl + WheelUp
    ;Sendinput, {[}                     ;Increase brush size
    return
$^wheeldown::
    tooltip, Ctrl + Wheeldown
    ;Sendinput, {]}                     ;Reduce brush size
    return

Is there a way to get AHK to "hide" the pressing or holding of control from the painting programme?


Solution

  • You can disable one of the Control keys in this program and use the other Control key to activate the move tool:

    #Requires AutoHotkey v1.1
    
    #IfWinActive ahk_exe program.exe
    
        ; disable the left Control key in this program 
        LCtrl::return
    
        ; left Control + wheel
        <^wheelup:: tooltip Ctrl + WheelUp
        <^wheeldown:: tooltip Ctrl + Wheeldown
    
    #IfWinActive ; turn off context sensitivity
    

    Replace program.exe with the ahk_exe of your program.