<?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: Keyboard modifier to keep cursor from crossing monitor borders</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=7d7fb460-0ac2-4519-8882-326bf0222acd" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=7d7fb460-0ac2-4519-8882-326bf0222acd</link>
<description>DisplayFusion RSS: Keyboard modifier to keep cursor from crossing monitor borders</description>
<lastBuildDate>Sun, 19 Apr 2026 12:23:09 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=7d7fb460-0ac2-4519-8882-326bf0222acd</generator>
<item>
<title>RE: Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#7</link>
<pubDate>Sat, 22 Dec 2018 10:14:13 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#7</guid>
<category>DisplayFusion</category>
<description><![CDATA[I'm sorry to add to this old thread but I'm trying to do something verysimilar to this... unfortunately my scripting ability is pretty basic.
I want to have the ability to have my mouse cursor locked to the current monitor only while my left mouse button is held down  (then unlocked again on lef...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I'm sorry to add to this old thread but I'm trying to do something <i>very</i>similar to this... unfortunately my scripting ability is pretty basic.<br/>
<br/>
I want to have the ability to have my mouse cursor locked to the current monitor only while my left mouse button is held down  (then unlocked again on left mouse button up).<br/>
<br/>
I was trying to modify Venryx's code but I just kept failing  <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-meh.light.svg" alt=":|" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":|" HelpButtonDataAlign="BelowMiddle" />   is what I'm trying to do even possible?  <br/>
<br/>
I could probly do this in autoit (I'm used to that)  but autoit interferes with the program I want to use this on LOL
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#6</link>
<pubDate>Mon, 05 Nov 2018 09:14:04 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[Regarding your mouse-lock request, I thought I'd mention that I had the same request, and managed to implement it using a custom script function.
Function description: Pressing and releasing this function's hotkey locks the mouse to the current monitor. It's then kept locked until you *press and...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Regarding your mouse-lock request, I thought I'd mention that I had the same request, and managed to implement it using a custom script function.<br/>
<br/>
Function description: Pressing and releasing this function's hotkey locks the mouse to the current monitor. It's then kept locked until you *press and hold down* the hotkey. While it's held down you can freely move between monitors. Once released, it gets locked again to the new current monitor.<br/>
<br/>
I've submitted it for inclusion to the script repository, but in the meantime, here's the script code:<br/>
<br/>
<div id="" 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="#code019da5b1d8ed73109f3f9c177ab21dec" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019da5b1d8ed73109f3f9c177ab21decJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019da5b1d8ed73109f3f9c177ab21decJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Threading;

public static class DisplayFusionFunction
{
    // update this value to match the hotkey you've assigned to this function -- ignoring ctrl, alt, etc. (I use Alt+A)
    static Keys hotkeyKey = Keys.A;

    [DllImport("user32")]
    static extern bool GetAsyncKeyState(int vKey);
    
    public static void Run(IntPtr windowHandle)
    {
        // if cursor is already unlocked by hotkey, don't start hotkey function again
        if (BFS.ScriptSettings.ReadValueBool("Cursor unlocked")) return;
    
        // unlock the mouse cursor since hotkey has been pressed down
        Cursor.Clip = Rectangle.Empty;
        BFS.ScriptSettings.WriteValueBool("Cursor unlocked", true);
        
        // wait until the hotkey is released
        while (GetAsyncKeyState((int)hotkeyKey)) {
            Thread.Sleep(10);
        }
        
        // then lock the mouse cursor again
        Cursor.Clip = BFS.Monitor.GetMonitorBoundsByMouseCursor();
        BFS.ScriptSettings.WriteValueBool("Cursor unlocked", false);
    }
}</pre><textarea id="code019da5b1d8ed73109f3f9c177ab21dec" name="code019da5b1d8ed73109f3f9c177ab21dec" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#5</link>
<pubDate>Wed, 28 Oct 2015 20:13:35 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[Yeah, that's a Windows limitation unfortunately. That issue is solved in Windows 10 though]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Yeah, that's a Windows limitation unfortunately. That issue is solved in Windows 10 though <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" />
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#4</link>
<pubDate>Tue, 27 Oct 2015 17:46:26 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Quote:
Thanks! I've added this to the feature request list as well
In the meantime, you can assign a key combination to the "Lock/Unlock Mouse Cursor to Current Monitor" function.
Thanks!
Also, as another note, I tried this and locking the cursor to the current monitor doesn't currently enabl...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
<div class="BackGrey"><div class="Text"><div><b>Quote:</b></div>Thanks! I've added this to the feature request list as well <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
In the meantime, you can assign a key combination to the "Lock/Unlock Mouse Cursor to Current Monitor" function.<br/>
<br/>
Thanks!</div></div><br/>
<br/>
Also, as another note, I tried this and locking the cursor to the current monitor doesn't currently enable window snapping. This is probably a Windows limitation, as Windows still knows that the edge of the screen isn't an edge of the display area. So it would be necessary to include some way to trick Windows into snapping windows when the cursor is right at the seam between two displays, or to add DisplayFusion's own way of mimicking the snap functionality when snapping to a border between two displays. Hope that made sense.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#3</link>
<pubDate>Tue, 27 Oct 2015 17:39:23 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks!! That is a possibility but it takes a few nano-seconds too long
I'm joking but I'm serious. As you probably know, when you're blazing through a workflow, every keystroke, click, and drag makes a difference. Especially when it comes to common tasks like moving windows around.
On that not...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks!! That is a possibility but it takes a few nano-seconds too long <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile-wink.light.svg" alt=";)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=";)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
I'm joking but I'm serious. As you probably know, when you're blazing through a workflow, every keystroke, click, and drag makes a difference. Especially when it comes to common tasks like moving windows around.<br/>
<br/>
On that note, it would be brilliant if instead of holding down a keyboard modifier, we could choose to hold down the right mouse button when dragging a window to activate the screen borders. That way we could get back window snapping just using the mouse, without even needing to use the other hand to hold down a key.<br/>
<br/>
Just an idea. As always thanks for the quick response and for adding the feature request!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#2</link>
<pubDate>Fri, 23 Oct 2015 17:35:32 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks! I've added this to the feature request list as well
In the meantime, you can assign a key combination to the "Lock/Unlock Mouse Cursor to Current Monitor" function. It's not quite as seamless, as it's just as straight toggle on/off, but hopefully that will help.
Thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks! I've added this to the feature request list as well <img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
In the meantime, you can assign a key combination to the "Lock/Unlock Mouse Cursor to Current Monitor" function. It's not quite as seamless, as it's just as straight toggle on/off, but hopefully that will help.<br/>
<br/>
Thanks!
</div>
]]></content:encoded>
</item>
<item>
<title>Keyboard modifier to keep cursor from crossing monitor borders</title>
<link>https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd</link>
<pubDate>Fri, 23 Oct 2015 14:28:21 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/keyboard-modifier-to-keep-cursor-from-crossing-monitor-borders/?ID=7d7fb460-0ac2-4519-8882-326bf0222acd</guid>
<category>DisplayFusion</category>
<description><![CDATA[I would like for DisplayFusion to add a keyboard modifier to keep the cursor from crossing monitor borders. Here's why.
PROBLEM 1: When you add a display to the left, right, or above your main display, you suddenly lose the super handy ability to snap windows to the left or right half of your sc...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I would like for DisplayFusion to add a keyboard modifier to keep the cursor from crossing monitor borders. Here's why.<br/>
<br/>
PROBLEM 1: When you add a display to the left, right, or above your main display, you suddenly lose the super handy ability to snap windows to the left or right half of your screen by dragging them to the side edges, or to maximize by dragging to the top edge.<br/>
<br/>
PROBLEM 2: When you add a display to the left, right, or above your main display, you also lose the ability to jam the cursor quickly against an edge, such as the top edge to click internet browser tabs, or into the corner to click the close/restore/minimize buttons, etc. You now have to gently ease the cursor to corners or edges of your screen whenever you need to click these commonly-used buttons.<br/>
<br/>
SOLUTION: If  you could hold down a key and prevent the cursor from crossing over to the next display, you could hold the key and get back the ability to snap windows by dragging them to the left, right, or top edge of the screen you're on. You could also hold the modifier key and be able to run the cursor up to your browser tabs or window close/restore/minimize buttons without it shooting past them into the next monitor.<br/>
<br/>
This is similar to another feature request I made <a href="http://www.displayfusion.com/Discussions/View/sticky-edges-for-particular-monitor-edge/?ID=a5822a9d-09ac-4d31-8dce-406f32b7211e" target="_blank" rel="nofollow"><b>here</b></a>, but that is for automatically sticky edges between specific displays, as opposed to a keyboard modifier to manually activate sticky edges.<br/>
<br/>
Thanks!
</div>
]]></content:encoded>
</item>
</channel>
</rss>