0

I've tried to solve this in Autohotkey with not success

In an program (from now on called VP0) there is a hotkey Space Click n Drag to Left/Right to set the tool Maximum Size

I would like to have the same hotkey as is native in VP0, but using Shift instead of Space

The problem is that there is a second native hotkey in VP0 which uses Shift Space Click n Drag to Left/Right to set the tool Minimum Size

The problem is that if I want to set the first VP0 hotkey in AHK I would set LShift should be Space (VP0 Tool Max Size), but since VP0 Tool Min Size = Shift Space when pressing LShift to set VP0 Tool Max Size it sets VP0 Tool Min Size cuz AHK detects that Shift is been pressed.

I have tried using...

SendInput {Shift Up}
SendEvent {Shift Up}

but it just send Shift Up for a few miliseconds, then AHK detect Shift is pressed again, how can I avoid that?? I also have tried THIS BELLOW, but I would like to avoid using loops, cuz it switchs rapidly between Set Brush Max Size n Set Brush Min Size.

;   Increase/Decrease Tool Size
#If WinActive("ahk_exe Verve_painter.exe") && !GetKeyState("XButton1", "P") && !GetKeyState("Space", "P")

LShift & LButton::    ; INCREASE TOOL MAX SIZE
    Tooltip, AAAAAAAAAAAAAAAAAA Shift LButton
    SendEvent {Shift Up}
    SendInput {Space Down}
    Click Down
    While GetKeyState("LButton","P")
    {
    SendEvent {Shift Up}
    }
    Tooltip, BBBBBBBBBBBBBBBBBBBBBB LButton was realeasedd

    SendInput {Space Up}
    Click Up
    Return


$^+LButton::    ; INCREASE TOOL MIN SIZE
    ;Tooltip, Shiiiit Ctrl Shift LButton
    SendInput {Ctrl Up}
    Sleep 10

    SendInput {Shift Down}
    SendInput {Space Down}
    Click Down
    KeyWait, LButton

    SendInput {Space Up}
    SendInput {Shift Up}
    Click Up
    Tooltip Ctrl SHift LButton was released
    Return

#If

Thanks Advanced.

  • please somebody heeelp – litu16 Feb 13 '17 at 15:43
1

Try to remap both Shift and Ctrl:

#If WinActive("ahk_exe Verve_painter.exe") && GetKeyState("Shift", "P")

       ; Shift+1
    $1:: 
        KeyWait, Shift
        SendInput, {Shift Up}
        MsgBox, Shift+1
        return

      ; Shift+2
    $2::
        KeyWait, Shift
        SendInput, {Shift Up}
        MsgBox, Shift+2
        return

#If WinActive("ahk_exe Verve_painter.exe") 

       Shift::Space

       Ctrl::Shift

#If
  • yes I tried that, but I have other AHK subroutines that use hotkey Shift 1 Shift 2 and they don't work if I do that. any idea? – litu16 Feb 14 '17 at 12:56
  • Try my edited answer. – user3419297 Feb 14 '17 at 15:19
  • Yes I could do that, but I would have to create a subroutine for every VP0 default hotkey that uses Shift modifier which is exhausting. So, so far I am using a SendEvent {Shift Up} inside a while loop, btw, why Ctrl::Shift ?? – litu16 Feb 16 '17 at 1:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.