Please help with mouse cursor move and pressing down Topic is solved
Please help with mouse cursor move and pressing down
Hello sir,
when I keep pressing down the Right mouse button, I'd like to do so at the center of the screen.
for that I made so far only:
RButton::MouseMove,959,539
to this, I'd like to add a function that also keeps pressing down the right mouse button, not only moving it to the center of the screen.
Can someone PLEASE HELP?
Thanks.
when I keep pressing down the Right mouse button, I'd like to do so at the center of the screen.
for that I made so far only:
RButton::MouseMove,959,539
to this, I'd like to add a function that also keeps pressing down the right mouse button, not only moving it to the center of the screen.
Can someone PLEASE HELP?
Thanks.
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: PLEASE HELP with mouse cursor move and pressing down
?
Code: Select all
RButton::MouseClick, Right, 959,539, 1, 50, D
Re: PLEASE HELP with mouse cursor move and pressing down
OH... that works, however, can you make the code that keeps pressing down when and only when i keep pressing the button PLEASE?
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: PLEASE HELP with mouse cursor move and pressing down
Well, this code will release the held down button, but ! when you press it again it will immidiately get held in again.
I don't know if this is the desired behaviour ? Can you explain a bit more about what you are trying to do ?
Are you using certain software in which you need to hold the right mouse button while moving to the center of the screen ?
Code: Select all
RButton::
MouseClick, Right, 959,539, 1, 50, D
GetKeyState, state, RButton
Loop
{
if !GetKeyState("state", "P") ; The key has been released, so break out of the loop.
break
}
MouseClick, Right,,,,, U
return
Code: Select all
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
#IfWinActive, ahk_exe notepad.exe ; <<<<< Only trigger the code when notepad is active. Change this to your programs exe file
RButton::
MouseClick, Right, 959,539, 1, 50, D
GetKeyState, state, RButton
Loop
{
if !GetKeyState("state", "P") ; The key has been released, so break out of the loop.
break
}
MouseClick, Right,,,,, U ; release the button
return
Re: PLEASE HELP with mouse cursor move and pressing down
what i wanna do is:
when i click the right mouse button and keep pressing it, i'd like that happen 'as the cursor is first automatically moved to the center of the screen'.
and when i release the right button, pressing down action also stops.
basically everything is same except the cursor must be at certain location.
Can you Please make such code?
when i click the right mouse button and keep pressing it, i'd like that happen 'as the cursor is first automatically moved to the center of the screen'.
and when i release the right button, pressing down action also stops.
basically everything is same except the cursor must be at certain location.
Can you Please make such code?
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Please help with mouse cursor move and pressing down
Still not completely sure if this is what you mean:
I would recommend adding a CTRL to the hotkey so you keep the original functionality of the right button. Like so:
I would recommend adding a CTRL to the hotkey so you keep the original functionality of the right button. Like so:
Code: Select all
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
^RButton:: ; press CTRL+RButton to trigger the script
click, down, right ; hold down the right mouse button
mousemove, 959, 539, 1 ; move to the center of the screen
click, up, right ; release the right button
return
Re: Please help with mouse cursor move and pressing down
sry about the poor explanation.
I'm playing a game called "VRising" atm. in this game, you can rotate a screen while holding down the right mouse button. and if you attack while you are holding down the right mouse button, your character attacks into the direction of where your mouse cursor was when the right mouse button was pressed down, not into the direction of the north of the screen. what i wanna do is, always attacking to northern direction (of the screen) while pressing down the right mouse button, no matter wherever the mouse cursor was positioned when the right mouse button was pressed down. and, it seems, the only way to make that possible, is moving your mouse cursor automatically to a certain northen position of the screen before pressing down and holding down the right mouse button.
hope this helps... PLEASE HELP ME
I'm playing a game called "VRising" atm. in this game, you can rotate a screen while holding down the right mouse button. and if you attack while you are holding down the right mouse button, your character attacks into the direction of where your mouse cursor was when the right mouse button was pressed down, not into the direction of the north of the screen. what i wanna do is, always attacking to northern direction (of the screen) while pressing down the right mouse button, no matter wherever the mouse cursor was positioned when the right mouse button was pressed down. and, it seems, the only way to make that possible, is moving your mouse cursor automatically to a certain northen position of the screen before pressing down and holding down the right mouse button.
hope this helps... PLEASE HELP ME
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Please help with mouse cursor move and pressing down Topic is solved
Okay so if I understand correctly. You first want move your mouse to 959, 539.
Then hold down the right mouse button ? And let it go when you physically release the right mouse button ?
Then hold down the right mouse button ? And let it go when you physically release the right mouse button ?
Code: Select all
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
RButton:: ; press RButton to trigger the script
mousemove, 959, 539, 1 ; move to the center of the screen
click, down, right ; hold down the right mouse button
Loop
{
if !GetKeyState("RButton", "P")
{
click, up, right ; release the right button
break
}
}
Last edited by WalkerOfTheDay on 25 May 2022, 08:52, edited 2 times in total.
Re: Please help with mouse cursor move and pressing down
WOW................ IT WORKS PERFECTLY!
/Salute to your supremacy, kindness, help!
you are my life-savior.
Thank You so much!!! <3
I LOVE YOU.
/Salute to your supremacy, kindness, help!
you are my life-savior.
Thank You so much!!! <3
I LOVE YOU.
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Please help with mouse cursor move and pressing down
Glad I could help.
Re: Please help with mouse cursor move and pressing down
Sir,
is there a way to move the mouse cursor faster?
what's the fastest way to move the cursor?
I want it to move almost as it teleported, is that possible?
as when i click the right mouse button while moving the cursor fast, sometimes the cursor doesn't get moved/fixed at the intended coordinate.
is there a way to move the mouse cursor faster?
what's the fastest way to move the cursor?
I want it to move almost as it teleported, is that possible?
as when i click the right mouse button while moving the cursor fast, sometimes the cursor doesn't get moved/fixed at the intended coordinate.
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Please help with mouse cursor move and pressing down
You can try to replace the 1 in the mousemove command to 0 but I doubt if that fixes it.
Perhaps someone with more advanced knowledge like @boiler can help out.
Perhaps someone with more advanced knowledge like @boiler can help out.
Re: Please help with mouse cursor move and pressing down
I would have also suggested changing the speed to 0, which is basically instantaneous.
Re: Please help with mouse cursor move and pressing down
i changed to:
mousemove, 959.5, 400, 0
however, still if i press down the right mouse button while moving around the mouse cursor fast, many times the cursor ends up not at the center. which ie werid to me as 0 speed should mean instantaneus.
weird, wierd...
maybe this is a bug or something physically not mendable???
mousemove, 959.5, 400, 0
however, still if i press down the right mouse button while moving around the mouse cursor fast, many times the cursor ends up not at the center. which ie werid to me as 0 speed should mean instantaneus.
weird, wierd...
maybe this is a bug or something physically not mendable???
- WalkerOfTheDay
- Posts: 710
- Joined: 24 Mar 2016, 03:01
Re: Please help with mouse cursor move and pressing down
You could try BlockInput to prevent mouse movements.
Run this as administrator (important !) It should block your physical mousemoves.
Run this as administrator (important !) It should block your physical mousemoves.
Code: Select all
#Persistent
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
RButton:: ; press RButton to trigger the script
BlockInput MouseMove
mousemove, 959, 539, 0 ; move to the center of the screen
BlockInput MouseMoveOff
click, down, right ; hold down the right mouse button
Loop
{
if !GetKeyState("RButton", "P")
{
click, up, right ; release the right button
break
}
}
return
ESC::
MsgBox, Bye
ExitApp