Tricky898 Posted April 5, 2011 Share Posted April 5, 2011 Hi. I'm very new to Autoit and writing scripts as a whole. However, I've had a look through the help files, and read the FAQ on the wiki but can't find a solution. I have no real application for this, but am just experimenting and am wondering how I can use a script to hold down CTRL and press and numpad number in order to move the mouse. I tried using: send("{Ctrldown}") send("{NUMPAD8}") send("{Ctrlup}") as this is what I physically press to get the mouse to shift upwards using mousekeys. However, nothing happens. Any help would be appreciated. Thanks Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 5, 2011 Share Posted April 5, 2011 How about: Send("^{NUMPAD8}") - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Tricky898 Posted April 5, 2011 Author Share Posted April 5, 2011 How about: Send("^{NUMPAD8}") I tried it, it still doesn't work. I guess its easier and more customisable to just use Autoit itself to move the mouse around. I've just created a similar script to do what Mousekeys does. Link to comment Share on other sites More sharing options...
bogQ Posted April 5, 2011 Share Posted April 5, 2011 Something like this? expandcollapse popupGlobal $var,$movment = 10 HotKeySet("^{NUMPAD8}","up") HotKeySet("^{NUMPAD2}","down") HotKeySet("^{NUMPAD4}","left") HotKeySet("^{NUMPAD6}","right") While 1 Sleep(10) WEnd Func up() $var = MouseGetPos() If $var[1] - $movment > 0 Then $var[1] -= $movment MouseMove($var[0],$var[1],0) Else MouseMove($var[0],0,0) EndIf EndFunc Func down() $var = MouseGetPos() If $var[1] + $movment < @DesktopHeight Then $var[1] += $movment MouseMove($var[0],$var[1],0) Else MouseMove($var[0],@DesktopHeight,0) EndIf EndFunc Func left() $var = MouseGetPos() If $var[0] - $movment > 0 Then $var[0] -= $movment MouseMove($var[0],$var[1],0) Else MouseMove(0,$var[1],0) EndIf EndFunc Func right() $var = MouseGetPos() If $var[0] + $movment < @DesktopWidth Then $var[0] += $movment MouseMove($var[0],$var[1],0) Else MouseMove(@DesktopWidth,$var[1],0) EndIf EndFunc TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Tricky898 Posted April 5, 2011 Author Share Posted April 5, 2011 Something like this? expandcollapse popupGlobal $var,$movment = 10 HotKeySet("^{NUMPAD8}","up") HotKeySet("^{NUMPAD2}","down") HotKeySet("^{NUMPAD4}","left") HotKeySet("^{NUMPAD6}","right") While 1 Sleep(10) WEnd Func up() $var = MouseGetPos() If $var[1] - $movment > 0 Then $var[1] -= $movment MouseMove($var[0],$var[1],0) Else MouseMove($var[0],0,0) EndIf EndFunc Func down() $var = MouseGetPos() If $var[1] + $movment < @DesktopHeight Then $var[1] += $movment MouseMove($var[0],$var[1],0) Else MouseMove($var[0],@DesktopHeight,0) EndIf EndFunc Func left() $var = MouseGetPos() If $var[0] - $movment > 0 Then $var[0] -= $movment MouseMove($var[0],$var[1],0) Else MouseMove(0,$var[1],0) EndIf EndFunc Func right() $var = MouseGetPos() If $var[0] + $movment < @DesktopWidth Then $var[0] += $movment MouseMove($var[0],$var[1],0) Else MouseMove(@DesktopWidth,$var[1],0) EndIf EndFunc Thanks, yeah that works as an alternative to Windows Mousekeys. However, I was wondering if a script could be created to replicate me pressing, say, CTRL+Num8 which would moev the mouse up by getting Autoit to hit those keys for me. An easier alternative at this stage would be to just get a script to run the functions in the code above, instead of trying to press the keys for Mousekeys, so thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now