StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
A script close to WinXcorners program and modified from Rob's Check if Mouse in Corner script
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)
|
It imitates WinXcorners that is open source in Github. It will do some actions one time when the mouse moves to the corners and stay in there, if the mouse moves back and move to the same corner again, the action will recover. I do a little modification base on Rob's script. Thanks, Rob. https://forum.strokesplu...ouse-in-Corner-of-ScreenPut the following code in Global Actions-Load/UnloadCode:
sp.CreateTimer("CornerCheck", 0, 200, `
var mousePos = sp.GetCurrentMousePoint();
var mouseScreen = Screen.FromPoint(mousePos);
if(mousePos.X == mouseScreen.Bounds.Right - 1 && mousePos.Y == mouseScreen.Bounds.Top) {
//Action in upper right corner
if(!sp.GetStoredBool("CornerCheckActive")) {
sp.SendModifiedVKeys([vk.LMENU], [vk.F4]);
sp.StoreBool("CornerCheckActive", true);
}
} else if(mousePos.X == mouseScreen.Bounds.Right - 1 && mousePos.Y == mouseScreen.Bounds.Bottom - 1) {
//Action in lower right corner
if(!sp.GetStoredBool("CornerCheckActive")) {
sp.SendModifiedVKeys([vk.LWIN], [vk.VK_D]);
sp.StoreBool("CornerCheckActive", true);
}
} else if(mousePos.X == mouseScreen.Bounds.Left && mousePos.Y == mouseScreen.Bounds.Top) {
//Action in upper left corner
if(!sp.GetStoredBool("CornerCheckActive")) {
//Put your code here
sp.StoreBool("CornerCheckActive", true);
}
} else if(mousePos.X == mouseScreen.Bounds.Left && mousePos.Y == mouseScreen.Bounds.Bottom - 1) {
//Action in lower left corner
if(!sp.GetStoredBool("CornerCheckActive")) {
sp.SendVKey(vk.LWIN);
sp.StoreBool("CornerCheckActive", true);
}
} else {
sp.StoreBool("CornerCheckActive", false);
}`
);
There are some actions for reference: Monitors Offsp.WindowFromHandle(new IntPtr(0xffff)).PostMessageObj(0x112, 0xf170, 2); All Windowssp.SendModifiedVKeys([vk.LWIN], [vk.TAB]); Hide Other Windowssp.SendModifiedVKeys([vk.LWIN], [vk.HOME]); A tip on Win10: Setting-System-Multitasking-Snap windowsIf you choose on, other windows will hide when you snap a foreground window, as well as hotkey Win+Home.
|
3 users thanked soooulp for this useful post.
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
A script close to WinXcorners program and modified from Rob's Check if Mouse in Corner script
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