remapping right click and drag as xbutton1 click a

2019-08-19 22:39发布

问题:

I want to remap right click and drag as XButton1 click and drag. This is what I tried:

RButtonclickdrag::XButton1clickdrag

I think I don't have the correct commands but I have searched a lot and not found anything else. Could somebody please give me some help?

Thanks, Ellen

回答1:

Here is a way to do this. Let me know if this suits your needs. The time is set to 100 ms.

#SingleInstance Force
#installKeybdHook
#Persistent

#ifWinActive ahk_class CorelDRAW 15.2
    $RButton::
        Sleep, 100
        GetKeyState, KeyState, RButton, p
        if KeyState = U
        {
            ;ToolTip, Short Press ; Activate to test behaviour
            Send, {RButton}
            Return
        }
        ;ToolTip, Long Press Started ; Activate to test behaviour
        sendmessage,0x111,0x1991d,0 ;pan one-shot
        MouseClick,L,,,1,0,D
        KeyWait, RButton
        ;ToolTip, Long Press Ended ; Activate to test behaviour
        MouseClick,L,,,1,0,U
    Return
#ifwinactive 


标签: autohotkey