
sss15
31 discussion posts
when I move mouse to other monitor and lock the mouse in current monitor, if I want to move mouse to primary monitor by hotkey, the mouse won't go to the primary monitor. So I have to unlock the mouse and then move it to primary monitor.
Is there a way to move to primary monitor directly, because I use hotkey so that the operation become easy.

sss15
31 discussion posts
Thanks for the reply。
I used scripted function as following,
public static class DisplayFusionFunction
{
public static void Run()
{
Rectangle primaryMonitorBounds = BFS.Monitor.GetPrimaryMonitorWorkArea();
//check to see if the mouse is already inside of the window
//if it is inside, exit the function
if (primaryMonitorBounds.Contains(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()))
return;
//should here be some codes to check if the mouse was locked???
BFS.Input.SetMousePosition(primaryMonitorBounds.Width / 2, primaryMonitorBounds.Height / 2);
}
}
Ok, so if you use the built-in "Move Mouse Cursor to Centre of Primary Monitor" function, it works, but it doesn't if you use your Scripted Function?

sss15
31 discussion posts
yes,because I also want to customized other related functions, for examples, using combination key to go directly to display #1,#2... in the case mouse is locked.
I think there are some code missed in the scripted function, but I can not find how to check and Unlock or Lock the mouse in script.
Ah ok. The script can't currently tell if the mouse cursor is locked or not. I've added an item to our list to make BFS.Input.SetMousePosition unlock the mouse if needed. We'll be sure to let you know when that's been implemented :)
Thanks!

sss15
31 discussion posts
Can I just call the existing DF-built function "Move Mouse to Center of Different Monitor' with the parameter in script?
You sure can! You can call it like this:
BFS.DisplayFusion.RunFunction("Move Mouse Cursor to Center of Primary Monitor");