Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

dvjrickkraft's profile on WallpaperFusion.com
Maybe a sticky for others? I searched everywhere but only found Move Mouse Cursor to Next Monitor. Thought this might help out others as I played around with it for two hours before finding if I removed 'Cursor' from the other thread's script, I finally got it to work.
https://www.displayfusion.com/Discussions/View/move-mouse-cursor-to-next-monitor-and-select-a-window/?ID=9629f8d2-9d63-4cb8-9ff0-0e3d8e451944

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run()
{
        // Move the mouse cursor to the next monitor
BFS.DisplayFusion.RunFunction("Move Mouse to Monitor 3");

// Wait 100ms
        BFS.General.ThreadWait(10);
        
        // Send a mouse left-click
        BFS.Input.LeftClickMouse();
}
}


Thanks for an excellent program, I've already purchased :laugh:
-Rick
Apr 22, 2018 (modified Apr 22, 2018)  • #1
PabloMartinez's profile on WallpaperFusion.com
I do not quite understand how you run this script, because the function "Move Mouse to Monitor 3" in DisplayFusion does not exist. If you created it, you had to show its code in the example, otherwise it does not make sense. Your task is solved quite simply:

Code

using System;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        // Show the monitor selector to select the desired monitor
        var monId = BFS.Monitor.ShowMonitorSelector();
        // Get the monitor bounds by its ID
        var bounds = BFS.Monitor.GetMonitorBoundsByID(monId);
        // Move the mouse to the center of the monitor
        BFS.Input.SetMousePosition(bounds.Width / 2 + bounds.X, bounds.Height / 2 + bounds.Y);
        // And send a mouse left-click
        BFS.Input.LeftClickMouse();
    }
}


Or even easier using the already ready function DisplayFusion

Code

using System;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        BFS.DisplayFusion.RunFunction("Move Mouse Cursor to Center of Different Monitor (shows monitor selector)");
        BFS.Input.LeftClickMouse();
    }
}
Apr 22, 2018 (modified Apr 22, 2018)  • #2
dvjrickkraft's profile on WallpaperFusion.com
As of DisplayFusion 5.1 Beta 16 (see https://www.displayfusion.com/Discussions/View/feature-request-hotkey-to-move-mouse-cursor-to-next-display/?ID=4f7b9b35-1021-43b1-aca7-891ea313b179) the function apparent DOES exist, because the code works, however I could not find documentation of it.

As I'm running a triple-monitor livestream where I show main cam and alternate two monitors, I really DON'T want the monitor selector coming up, especially when I hit a hotkey to direct it to monitor 3, and another hotkey to direct it to monitor 2, to load/show graphics. This code does work, tested fully before posting! I'd be happy to provide further details.
Thanks to Binaryfortress/Displayfusion for making this amazing program!
• Attachment: DS scipt.jpg [397,503 bytes]
DS scipt.jpg
DS scipt.jpg
Apr 22, 2018  • #3
PabloMartinez's profile on WallpaperFusion.com
Oh yes. I looked in ready-made functions DisplayFusion and completely forgot about custom functions (because I use this functionality very very rarely, creating mostly scripts), where this functionality is really present.
Apr 23, 2018  • #4
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)