<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>DisplayFusion RSS: Move window and mouse to specific monitor split?</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2</link>
<description>DisplayFusion RSS: Move window and mouse to specific monitor split?</description>
<lastBuildDate>Sat, 21 Nov 2026 02:53:03 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2</generator>
<item>
<title>RE: Move window and mouse to specific monitor split?</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2#4</link>
<pubDate>Wed, 10 Apr 2024 14:29:06 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[I don't think there's a way to do what you're looking for all in one script. You'll need to separate them into 4 scripts, with your hotkey for each attached to each direction.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I don't think there's a way to do what you're looking for all in one script. You'll need to separate them into 4 scripts, with your hotkey for each attached to each direction.
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=018e9ec9-0941-770a-8de2-4865c540af9a"/>
</item>
<item>
<title>RE: Move window and mouse to specific monitor split?</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2#3</link>
<pubDate>Thu, 04 Apr 2024 14:18:47 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks! See attached for updated function.
Is there a way to pass a parameter to a function? So I have hotkeys for moving the window up,down,left, or right, but for now, I need to duplicate the same function for all four actions and modify a variable to tell the function which direction is invok...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks! See attached for updated function.<br/>
<br/>
Is there a way to pass a parameter to a function? So I have hotkeys for moving the window up,down,left, or right, but for now, I need to duplicate the same function for all four actions and modify a variable to tell the function which direction is invoked.<br/>
<br/>
But perhaps I'm pointlessly over-complicating a simple system. Last thing I want is to reduce responsiveness. I've noticed that if I haven't used a hotkey recently, it takes a few seconds for it to react. Maybe it gets unloaded from memory to reduce memory usage? Maybe all functions with hotkeys should always be in memory?<br/>
<br/>
I'm using this function with an Apple Magic Trackpad on Win10 via github drivers that implement the Windows Precision Touch Protocol. Windows lets me assign custom gestures to keystrokes so now I have four-finger swipe up/down/left/right to match the DF hotkeys of crtl-alt-up/down/left/right to move windows between splits.<br/>
<br/>
Neat thing I just found out is that I can use the SHIFT key to modify the above gestures. So in DF, I have ctrl-alrt-SHIFT-up/down/left/right run functions that expand the window size to include the split in the chosen direction. So without changing the four-finger swipe settings in windows, I can use the same gestures with the SHIFT button to expand a window.<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a1fc05886d7644a636f442a399bdc5" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a1fc05886d7644a636f442a399bdc5Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a1fc05886d7644a636f442a399bdc5Js" name="code01a1fc05886d7644a636f442a399bdc5Js" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;&#xA;// move window under mouse up split&#xA;&#xA;// The &#x27;windowHandle&#x27; parameter will contain the window handle for the:&#xA;//   - Active window when run by hotkey&#xA;//   - Trigger target when run by a Trigger rule&#xA;//   - TitleBar Button owner when run by a TitleBar Button&#xA;//   - Jump List owner when run from a Taskbar Jump List&#xA;//   - Currently focused window if none of these match&#xA;public static class DisplayFusionFunction&#xA;{&#xA;    &#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        string direction = &quot;up&quot;;&#xA;        &#xA;        // Get the window under the mouse&#xA;        IntPtr windowUnderMouse = BFS.Window.GetWindowUnderMouse();&#xA;&#xA;        uint sourceMonitor = BFS.Monitor.GetMonitorIDByWindow(windowUnderMouse);    &#xA;        uint targetMonitor = 1;&#xA;        &#xA;        switch(direction){&#xA;            case &quot;up&quot;:&#xA;                switch(sourceMonitor){&#xA;                    case 201:&#xA;                        targetMonitor = 202;&#xA;                        break;&#xA;                    case 202:&#xA;                        targetMonitor = 201;&#xA;                        break;    &#xA;                    case 203:&#xA;                        targetMonitor = 1;&#xA;                        break;&#xA;                    case 204:&#xA;                        targetMonitor = 203;&#xA;                        break;&#xA;                    case 205:&#xA;                        targetMonitor = 1;&#xA;                        break;&#xA;                    case 206:&#xA;                        targetMonitor = 205;&#xA;                        break;&#xA;                    case 207:&#xA;                        targetMonitor = 208;&#xA;                        break;&#xA;                    case 208:&#xA;                        targetMonitor = 207;&#xA;                        break;&#xA;                    case 1:&#xA;                        targetMonitor = 206;&#xA;                        break;&#xA;                }&#xA;                break;&#xA;            case &quot;down&quot;:&#xA;                switch(sourceMonitor){&#xA;                    case 201:&#xA;                        targetMonitor = 202;&#xA;                        break;&#xA;                    case 202:&#xA;                        targetMonitor = 201;&#xA;                        break;    &#xA;                    case 203:&#xA;                        targetMonitor = 204;&#xA;                        break;&#xA;                    case 204:&#xA;                        targetMonitor = 1;&#xA;                        break;&#xA;                    case 205:&#xA;                        targetMonitor = 206;&#xA;                        break;&#xA;                    case 206:&#xA;                        targetMonitor = 1;&#xA;                        break;&#xA;                    case 207:&#xA;                        targetMonitor = 208;&#xA;                        break;&#xA;                    case 208:&#xA;                        targetMonitor = 207;&#xA;                        break;&#xA;                    case 1:&#xA;                        targetMonitor = 205;&#xA;                        break;&#xA;                }&#xA;                break;&#xA;            case &quot;right&quot;:&#xA;                switch(sourceMonitor){&#xA;                    case 201:&#xA;                        targetMonitor = 203;&#xA;                        break;&#xA;                    case 202:&#xA;                        targetMonitor = 204;&#xA;                        break;    &#xA;                    case 203:&#xA;                        targetMonitor = 205;&#xA;                        break;&#xA;                    case 204:&#xA;                        targetMonitor = 206;&#xA;                        break;&#xA;                    case 205:&#xA;                        targetMonitor = 207;&#xA;                        break;&#xA;                    case 206:&#xA;                        targetMonitor = 208;&#xA;                        break;&#xA;                    case 207:&#xA;                        targetMonitor = 201;&#xA;                        break;&#xA;                    case 208:&#xA;                        targetMonitor = 202;&#xA;                        break;&#xA;                    case 1:&#xA;                        targetMonitor = 1;&#xA;                        break;&#xA;                }&#xA;                break;&#xA;            case &quot;left&quot;:&#xA;                switch(sourceMonitor){&#xA;                    case 201:&#xA;                        targetMonitor = 207;&#xA;                        break;&#xA;                    case 202:&#xA;                        targetMonitor = 208;&#xA;                        break;    &#xA;                    case 203:&#xA;                        targetMonitor = 201;&#xA;                        break;&#xA;                    case 204:&#xA;                        targetMonitor = 202;&#xA;                        break;&#xA;                    case 205:&#xA;                        targetMonitor = 203;&#xA;                        break;&#xA;                    case 206:&#xA;                        targetMonitor = 204;&#xA;                        break;&#xA;                    case 207:&#xA;                        targetMonitor = 205;&#xA;                        break;&#xA;                    case 208:&#xA;                        targetMonitor = 206;&#xA;                        break;&#xA;                    case 1:&#xA;                        targetMonitor = 1;&#xA;                        break;&#xA;                }&#xA;                break;                &#xA;        }&#xA;                &#xA;        BFS.Window.MoveToMonitor(targetMonitor, windowUnderMouse);&#xA;        BFS.Window.Maximize(windowUnderMouse);&#xA;        Rectangle targetMonitorBounds = BFS.Monitor.GetMonitorBoundsByID(targetMonitor);&#xA;        Point targetMousePosition = new Point(targetMonitorBounds.X &#x2B; (targetMonitorBounds.Width / 2), targetMonitorBounds.Y &#x2B; (targetMonitorBounds.Height / 2));&#xA;        BFS.Input.SetMousePosition(targetMousePosition.X, targetMousePosition.Y);        &#xA;    }&#xA;}</pre><textarea id="code01a1fc05886d7644a636f442a399bdc5" name="code01a1fc05886d7644a636f442a399bdc5" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=018e9ec9-0941-770a-8de2-4865c540af9a"/>
</item>
<item>
<title>RE: Move window and mouse to specific monitor split?</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2#2</link>
<pubDate>Wed, 03 Apr 2024 14:34:28 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[We don't have a built in function for moving the mouse to a target monitor. Try this:
Line 53:
BFS.Window.MoveToMonitor(targetMonitor, windowUnderMouse);
Line 54-57:
uint targetMonitor = 1;
Rectangle targetMonitorBounds = BFS.Monitor.GetMonitorBoundsByID(targetMonitor);
Point targetMousePos...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
We don't have a built in function for moving the mouse to a target monitor. Try this: <br/>
<br/>
Line 53: <br/>
<br/>
BFS.Window.MoveToMonitor(targetMonitor, windowUnderMouse);<br/>
<br/>
Line 54-57: <br/>
<br/>
uint targetMonitor = 1;<br/>
Rectangle targetMonitorBounds = BFS.Monitor.GetMonitorBoundsByID(targetMonitor);<br/>
Point targetMousePosition = new Point(targetMonitorBounds.X + (targetMonitorBounds.Width / 2), targetMonitorBounds.Y + (targetMonitorBounds.Height / 2));<br/>
BFS.Input.SetMousePosition(targetMousePosition.X, targetMousePosition.Y);
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=018e9ec9-0941-770a-8de2-4865c540af9a"/>
</item>
<item>
<title>Move window and mouse to specific monitor split?</title>
<link>https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2</link>
<pubDate>Tue, 02 Apr 2024 12:22:29 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/move-window-and-mouse-to-specific-monitor-split/?ID=018e9ec2-c68e-76a9-ab62-a4b6776d83a2</guid>
<category>DisplayFusion</category>
<description><![CDATA[I'm trying to create hotkeys to move the window under the mouse to an adjacent split. I don't want just move to next/prev but support up and down. Up and down is a bit harder to do so I just hardcode the destination split dpending on the current split.
But I can't seem to get it to do anything. ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I'm trying to create hotkeys to move the window under the mouse to an adjacent split. I don't want just move to next/prev but support up and down. Up and down is a bit harder to do so I just hardcode the destination split dpending on the current split.<br/>
<br/>
But I can't seem to get it to do anything. Maybe I'm using function "Move Window to Monitor X#" wrong?<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code01a1fc05888173c1bee5cf98dec5bc2c" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code01a1fc05888173c1bee5cf98dec5bc2cJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code01a1fc05888173c1bee5cf98dec5bc2cJs" name="code01a1fc05888173c1bee5cf98dec5bc2cJs" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Drawing;&#xA;&#xA;// move window under mouse &quot;up&quot;&#xA;&#xA;// The &#x27;windowHandle&#x27; parameter will contain the window handle for the:&#xA;//   - Active window when run by hotkey&#xA;//   - Trigger target when run by a Trigger rule&#xA;//   - TitleBar Button owner when run by a TitleBar Button&#xA;//   - Jump List owner when run from a Taskbar Jump List&#xA;//   - Currently focused window if none of these match&#xA;public static class DisplayFusionFunction&#xA;{&#xA;    &#xA;    public static void Run(IntPtr windowHandle)&#xA;    {&#xA;        &#xA;        // Get the window under the mouse&#xA;        IntPtr windowUnderMouse = BFS.Window.GetWindowUnderMouse();&#xA;&#xA;        uint sourceMonitor = BFS.Monitor.GetMonitorIDByWindow(windowUnderMouse);    &#xA;        uint targetMonitor = 1;&#xA;        switch(sourceMonitor){&#xA;            case 201:&#xA;                targetMonitor = 202;&#xA;                break;&#xA;            case 202:&#xA;                targetMonitor = 201;&#xA;                break;    &#xA;            case 203:&#xA;                targetMonitor = 1;&#xA;                break;&#xA;            case 204:&#xA;                targetMonitor = 203;&#xA;                break;&#xA;            case 205:&#xA;                targetMonitor = 1;&#xA;                break;&#xA;            case 206:&#xA;                targetMonitor = 205;&#xA;                break;&#xA;            case 207:&#xA;                targetMonitor = 208;&#xA;                break;&#xA;            case 208:&#xA;                targetMonitor = 207;&#xA;                break;&#xA;            case 1:&#xA;                targetMonitor = 204;&#xA;                break;&#xA;        }&#xA;        &#xA;        BFS.DisplayFusion.RunFunction(&quot;Move Window to Monitor {targetMonitor}&quot;);&#xA;        BFS.DisplayFusion.RunFunction(&quot;Move Mouse Cursor to Monitor {targetMonitor}&quot;);&#xA;    }&#xA;}</pre><textarea id="code01a1fc05888173c1bee5cf98dec5bc2c" name="code01a1fc05888173c1bee5cf98dec5bc2c" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
<media:thumbnail url="https://www.displayfusion.com/Discussions/Download/?ID=018e9ec9-0941-770a-8de2-4865c540af9a"/>
</item>
</channel>
</rss>