-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock mouse #43
Comments
If you want your game to use a whole screen AND catch your mouse, why aren't you playing it in normal fullscreen? As far as I know the only reason to go borderless IS to have the game fullscreen and still be able to move your mouse to the other monitors. I might be missing something so please clarify. |
There are more reasons for wanting it. Mainly it will load the rest of the desktop faster and I can see the game and what is going on when I am on the desktop (two monitors). I can alt-tab quicker. Basically the mouse should lock into the app until I alt tab then I can user other apps. |
Mouse locking is left up to the developers of the game, there is no way I On Sat, Mar 1, 2014 at 7:08 AM, Shane A. Faulkner
|
There actually is a way. Check out this utility. The only problem I have with this one is it locks it 1 or 2 pixels to far and doesn't work if u move the mouse too fast. http://dotautilities-forums.net/Thread-Tool-Warcraft-III-Runner |
And it may not be in the WinAPI I just know that this guy found a way to do it, |
There is an WinAPI Function called ClipCursor that does limit the mousecursor to a given rectangle. If we use the rectangle of the screen the window is on it should work. However this is a global change, so we'd need to figure out a reliable way to enable/disable this on window-switching. polling the currently active window could work. If noone else does I might take a look at this. |
The way the app that I linked does it is it allows you to set scroll lock to the hotkey that enables and disables it. Thanks for looking into it. |
Good news, I investigated and got this working. The hotkey will work on both bordered and borderless windows. I'll clean up my changes and upload a test-release on my fork. Would you be willing to test it before pushing the changes to master? |
Awesome, thank you for doing this! I would be more than willing to test it out. |
Ok, I uploaded the version here: http://behind.at/tmp/BorderlessGaming-6-mouselock.zip To test, you need to enable the mouselock-hotkey in the options, select your game and press Scrolllock. This should clip the mouse to your window. Pressing Scrolllock again unlocks the cursor (also windows automatically unlocks the cursor on specific events like alt-tab for example. Due to this you need to press scrolllock twice to re-capture the cursor after its lost.) |
Fantastic! As soon as I'm home from work I will test it and let you know |
Great job man it works perfectly and even better than the one I had linked as an example! My mouse does not leave the screen with this if I go very fast. The alt-tab is awesome also - great job! The only suggestion I have (if even possible) is re-locking the mouse when the app gets refocused after alt-tab. However, it is not really that needed and pressing the hotkey again twice is no biggy! Thank you again. |
Automatic re-locking is (sadly) not possible, but I added a simple fix so it's not needed to press the hotkey twice after loosing the lock. |
I'd maybe leave leave it to the double press because it keeps the scroll lock at the same on state. But it is up to you and what you think is better, thank you! |
the implementation got merged and this issue can be closed. |
This feature is not working for me. Hitting scroll lock with the option enabled does not lock the pointer to the game's monitor. |
This program works great I only have one suggestion. On multiple monitors my mouse does not lock in the game. So in WC3 when I need to use the mouse to move the screen it will go off game into the second monitor.
The text was updated successfully, but these errors were encountered: