Hey,
I'm new here and I have no idea about scripting. I'm a CAD user, using SolidWorks. I don't like to hold middle mouse (wheel) to orbit inside the software. So I am looking for a script, that do the following:
When I just press and release the right mouse button -> make a normal right mouse button press and release.
But when I hold the right mouse button and also start to move my mouse courser -> simulate that I hold the mittle button.
I have googled for scripts like this but I did not found anything like it. I found similar scripts, so I think it could be possible. But with no idea about coding I was not able to create my own script. I hope someone can help me out. Thank you all in advance.
Greetings,
Henry
Looking for a Right Mouse to Middle Mouse Hold Script Topic is solved
Re: Looking for a Right Mouse to Middle Mouse Hold Script
The middle mouse button will trigger if you hold down the right mouse button for 200ms. You can increase this time by changing T0.2 to a higher value.
Code: Select all
$RButton::
keywait, RButton, T0.2
if (Errorlevel = 1)
{
Click, down, Middle
KeyWait, RButton
Click, up, Middle
}
else
Click, Right
Last edited by ilhom on 20 Sep 2019, 02:11, edited 2 times in total.
Re: Looking for a Right Mouse to Middle Mouse Hold Script
Wow... that was fast! And it works like a charm. Thank you very much!
Edit: I can not use the CTRL modifier with this script. So, If I press CTRL + hold right button, I don't get the CTRL + middle mouse hold. Is there a way to fix it? I can live without it, but it would be the cherry on top.
Edit 2: I do not know if it makes sense, but I've tested some things an this seem to work
Edit 3: It does not work.
Edit 4: I've tried this but I get an unwanted right click when I release the RButton Hold
Edit: I can not use the CTRL modifier with this script. So, If I press CTRL + hold right button, I don't get the CTRL + middle mouse hold. Is there a way to fix it? I can live without it, but it would be the cherry on top.
Edit 2: I do not know if it makes sense, but I've tested some things an this seem to work
Code: Select all
^RButton::
SendInput {RButton Down}
$RButton::
keywait, RButton, T0.2
if (Errorlevel = 1)
{
Click, down, Middle
KeyWait, RButton
Click, up, Middle
}
else
Click, Right
Edit 4: I've tried this but I get an unwanted right click when I release the RButton Hold
Code: Select all
$RButton::
keywait, RButton, T0.2
if (Errorlevel = 1)
{
Click, down, Middle
KeyWait, RButton
Click, up, Middle
}
else
Click, Right
$^RButton::
keywait, RButton, T0.2
if (Errorlevel = 1)
{
Click, down, Middle
Click, down, CTRL
KeyWait, RButton
Click, up, Middle
Click, up, CTRL
}
else
Click, Right
Re: Looking for a Right Mouse to Middle Mouse Hold Script
Maybe someone else has a solution to my problem? Otherwise, I leave it here and I'm glad that it works almost as well as I wanted.
Re: Looking for a Right Mouse to Middle Mouse Hold Script
Try this
Code: Select all
;Change acad.exe with your software name
#IfWinActive ahk_exe acad.exe
$RButton::
keywait, RButton, T0.150
if Errorlevel
{
Send, {MButton Down}
KeyWait, RButton, L
}
else
Send, {RButton}
return
$RButton Up::
Send, {MButton Up}
return
Re: Looking for a Right Mouse to Middle Mouse Hold Script
Thanks for your help. Unfortunately your script works exactly like ilhom's (missing the CTRL modofier function). Just to make sure that there are no misunderstandings, here are the things that I asked for:
When I single click RButton -> normal RButton click (works fine with both scripts)
When I hold RButton -> simulate MButton hold (works fine with both scripts)
When I press CTRL + hold RButton -> send CTRL + hold MButton (does not work with both scripts)
When I single click RButton -> normal RButton click (works fine with both scripts)
When I hold RButton -> simulate MButton hold (works fine with both scripts)
When I press CTRL + hold RButton -> send CTRL + hold MButton (does not work with both scripts)
Re: Looking for a Right Mouse to Middle Mouse Hold Script
try this
Code: Select all
;Change acad.exe with your software name
#IfWinActive ahk_exe acad.exe
*$RButton::
keywait, RButton, T0.150
if Errorlevel
{
Send, {MButton Down}
KeyWait, RButton, L
}
else
Send, {RButton}
return
$RButton Up::
Send, {MButton Up}
return
Re: Looking for a Right Mouse to Middle Mouse Hold Script
Does not work either.
With you first script I've got a normal right click wehen using the CTRL modifier. With the new script I've got the hold Mbutton, but CTRL does not got recognized.
With you first script I've got a normal right click wehen using the CTRL modifier. With the new script I've got the hold Mbutton, but CTRL does not got recognized.
Re: Looking for a Right Mouse to Middle Mouse Hold Script Topic is solved
Adding the wildcard to my original should do what you're asking. This will also work with alt, shift, etc.
Code: Select all
$*RButton::
keywait, RButton, T0.2
if (Errorlevel = 1)
{
Click, down, Middle
KeyWait, RButton
Click, up, Middle
}
else
Click, Right
Who is online
Users browsing this forum: No registered users and 130 guests