Rank: Advanced Member
Groups: Moderators, Approved Joined: 4/23/2020(UTC) Posts: 161 Thanks: 46 times Was thanked: 23 time(s) in 17 post(s)
|
I want to restrict the mouse at a specific point, like (0,0) or action end, and forbid it to move to the corner of the screen when moving the computer.
I try the following code and it can restrict the mouse at the rectangle with an action.
sp.MouseRestrictToRectangle(action.Window.Rectangle);
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
Code:if(sp.MouseRestrictActive()) {
// Remove mouse restriction
sp.MouseRestrictClear();
} else {
// Create empty rectangle, confines mouse to 0,0
sp.MouseRestrictToRectangle(new Rectangle());
}
Note that if you press the ignore key, the mouse restriction is stopped until the ignore key is released Edited by user Friday, April 16, 2021 3:48:35 PM(UTC)
| Reason: Not specified
|
2 users thanked Rob for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close