Hello, hope all is well, try this out
As you have mentioned you are new, I've tried to type the instructions as clear as possible
First you need to download the ZIP attachment to your computer and extract it.
These 2 files will be extracted, extract to whatever folder you want.
_AJC Cursor Cross Over Two Monitors.dfscript
_AJC Cursor Cross Over Two Monitors Reset.dfscript
Once they're extracted, follow the following steps,
- Open DF Settings
- Click on <Functions> in the Settings List
- Click <Scripted Function> button at top of window
- Select <Import Scripted Function>
- Navigate to the folder where you downloaded the attachments and import them, one at a time
- "_AJC Cursor Cross Over Two Monitors.dfscript"
- "_AJC Cursor Cross Over Two Monitors Reset.dfscript"
- When both are imported, click <APPLY> at bottom of Settings screen
You should now have 2 new functions in the Scripted Functions List
"_AJC Cursor Cross Over Two Monitors" - the main function to be triggered
"_AJC Cursor Cross Over Two Monitors Reset" - This will allow you to to reset the script settings if needed, either by directly running the script or assigning a hotkey to it. There's no need to worry about uncommenting the line in the previous script then.
Referencing your screenshot, I've assigned
- Monitor3 to the Left (uiMonitorID_A)
- Monitor4 to the Right (uiMonitorID_B)
You can change them in the code if you move monitors or something.
Edge Detection Sensitivity is set to 2 and stored in the variable <int iEdgeThreshold = 2>
It's just the number of pixels from the edge that will trigger the cursor crossover. In your setup though, 2 is plenty.
Just move the mouse cursor to the monitor edge until it stops moving and it should jump within a second
Now all that needs to be done is to create a Trigger for the script.
First, let's setup the Trigger Event,
- Click on <Triggers> in the Settings List
- Click <ADD> button at bottom of Settings Screen
- A new Trigger window will open
- Click <Event> Dropdown button in new window
- Select <Timer Interval> Event
- A new value box will appear called <Interval (sec)>
- Set <Interval (sec)> to 1 or maybe a bit higher if you want more of a delay for some reason.
Now let's setup the Trigger Function,
- Click <ADD> button underneath listbox at bottom of Trigger Screen
- Select <Run Function>
- Select "_AJC Cursor Cross Over Two Monitors" from the list
- Make sure you didn't select the Reset one! D:
- "_AJC Cursor Cross Over Two Monitors" should be added to the Trigger list
- Click <OK>
Click <APPLY> at bottom of Settings screen, until you click <APPLY> the Trigger won't be enabled
Hopefully all should be good now, there is a slight delay and there's nothing I can do about that using this method.
Happy mouse cursor monitor jumping
!!! I've included the code here so others can see it's not dodgy or anything
!!!
// !!!!! UNCOMMENT next line to reinitialise script !!!!! Rememeber to RECOMMENT line if script is reinitialised !!!!!
//BFS.ScriptSettings.WriteValueBool("CursorCrossOverTwoMonitors_bScriptIsInitialised", false);
bool bScriptIsInitialised = BFS.ScriptSettings.ReadValueBool("CursorCrossOverTwoMonitors_bScriptIsInitialised");
// Set these to whatever monitor ID's are needed
// Based on the screenshot, these should be correct
uint uiMonitorID_A = 3;
uint uiMonitorID_B = 4;
// Amount of pixels from edges to detect if cursor needs to cross over
// i.e. Edge Detection Sensitivity
// No need to store this as a script setting
int iEdgeThreshold = 2;
// As the script will be triggered once every second,
// we don't want to be constantly reading monitor bounds values
// so just read them once and store them in script settings
if (!bScriptIsInitialised) {
// Initialise script settings
// Get monitors bounds and store them
Rectangle rectMonitorA = BFS.Monitor.GetMonitorBoundsByID(uiMonitorID_A);
Rectangle rectMonitorB = BFS.Monitor.GetMonitorBoundsByID(uiMonitorID_B);
// We could store all the values but we don't need to
// Just the left side monitor's Right Edge value and
// the right side monitor's left edge value are required
BFS.ScriptSettings.WriteValueInt("CursorCrossOverTwoMonitors_iMonitorA_Right",rectMonitorA.Right);
BFS.ScriptSettings.WriteValueInt("CursorCrossOverTwoMonitors_iMonitorB_Left",rectMonitorB.Left);
// Set script is initialised flag
BFS.ScriptSettings.WriteValueBool("CursorCrossOverTwoMonitors_bScriptIsInitialised", true);
} else {
// Script is initialised
// Read the stored monitor edge values
int iMonitorA_Right = BFS.ScriptSettings.ReadValueInt("CursorCrossOverTwoMonitors_iMonitorA_Right");
int iMonitorB_Left = BFS.ScriptSettings.ReadValueInt("CursorCrossOverTwoMonitors_iMonitorB_Left");
// Get the monitor ID at the current mouse cursor position
int iMouseX = BFS.Input.GetMousePositionX();
int iMouseY = BFS.Input.GetMousePositionY();
uint uiCurrentid = BFS.Monitor.GetMonitorIDByXY(iMouseX, iMouseY);
// Only check mouse cursor position when on a monitor that needs to be checked
if ((uiCurrentid == uiMonitorID_A) && (iMouseX > (iMonitorA_Right - iEdgeThreshold)))
BFS.Input.SetMousePosition(iMonitorB_Left, iMouseY);
else if ((uiCurrentid == uiMonitorID_B) && (iMouseX < (iMonitorB_Left + iEdgeThreshold)))
BFS.Input.SetMousePosition(iMonitorA_Right, iMouseY);
} // end if !bScriptIsInitialised
// reinitialise Mouse Cursor Cross Over Two Monitors script
BFS.ScriptSettings.WriteValueBool("CursorCrossOverTwoMonitors_bScriptIsInitialised", false);