premiumg Posted January 17, 2007 Share Posted January 17, 2007 (edited) I'm building a HTPC and this mouse cursor is always in the middle of the TV screen. I am not using Media Center but a different software. I'd like to have a script run on startup that hides the mouse cursor until a certain keyboard combo is pressed (i.e. ESC + ALT) I'm very new to AutoIt so please help me! I'm looking through the help file at mouse commands but I don't see anything to hide cursor. Edited January 17, 2007 by premiumg Link to comment Share on other sites More sharing options...
Joon Posted January 17, 2007 Share Posted January 17, 2007 This is not hiding but should work for your case. #include <Misc.au3> HotKeySet("{F10}", "ReleaseMouse") $MousePos = MouseGetPos() _MouseTrap(@DesktopWidth, @DesktopHeight, @DesktopWidth, @DesktopHeight) While 1 Sleep(150) WEnd Func ReleaseMouse() _MouseTrap() MouseMove($MousePos[0], $MousePos[1], 0) Exit EndFunc Link to comment Share on other sites More sharing options...
premiumg Posted January 17, 2007 Author Share Posted January 17, 2007 This is not hiding but should work for your case. #include <Misc.au3> HotKeySet("{F10}", "ReleaseMouse") $MousePos = MouseGetPos() _MouseTrap(@DesktopWidth, @DesktopHeight, @DesktopWidth, @DesktopHeight) While 1 Sleep(150) WEnd Func ReleaseMouse() _MouseTrap() MouseMove($MousePos[0], $MousePos[1], 0) Exit EndFunc Thanks man, seems to work. Can you tell me what the code does? What does sleep(150) do? This program seems to move the cursor off the screen rather than hide it, correct? 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