0
votes

I want to remap left click of my mouse to mouse wheel up when a certain keyboard key(let's say SHIFT) is hold. It should go back to normal after the key is released.

Here is my current script:

Loop
{
If(GetKeyState("Shift", "P"))
LButton::WheelUp

If(GetKeyState("Shift", "P")=0)
Hotkey, *LButton, off
}

I have two problems with it:

  1. It remaps my left button without any pressed key.
  2. I want it to continuously do "wheel up" as long as the SHIFT key is down and the left mouse button is pressed.
1
What have you tried so far. Do you have a handler for the wheel up? I am unsure as to what our actual question is. The answer as to how to do this would depend on what type of application you have. Is it a Windows Forms app, is it WPF, is it UWP, is it Asp.Net? Are you only handling the keypress/mouse combination when the mouse is over a particular area? Please clarify what you are looking to do. If you question is "Is it possible?" the answer is, "Most likely yes."pstrjds
Sorry, I updated it.Varihlu
You have updated it to include an Autohotkey script. So do you want a C# answer or Autohotkey. You have tagged both in your question. If you want a C# answer then please show what you have tried in C# so far.pstrjds

1 Answers

0
votes

The following will send WheelUp every 0.5 seconds as long as SHIFT and left mouse button are pressed:

+LButton::
    sendWheelUp := true
    while (sendWheelUp) {
        send, {WheelUp}
        sleep 500
    }
return

+LButton up::sendWheelUp := false

You can adjust sleep time to increase or decrease the frequency.