<?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: Help with Custom Function</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165</link>
<description>DisplayFusion RSS: Help with Custom Function</description>
<lastBuildDate>Sat, 23 May 2026 16:20:14 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165</generator>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#9</link>
<pubDate>Tue, 09 Jun 2015 14:55:58 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#9</guid>
<category>DisplayFusion</category>
<description><![CDATA[Ok, I think we'd need to add a scripting function to disable hotkeys while the script is running, or something like that. I'll put this on our list for further investigation]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, I think we'd need to add a scripting function to disable hotkeys while the script is running, or something like that. I'll put this on our list for further investigation <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: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#8</link>
<pubDate>Mon, 08 Jun 2015 20:39:21 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#8</guid>
<category>DisplayFusion</category>
<description><![CDATA[Yep that is exactly the issue.. Spacebar is the hotkey, that I want to trigger the script, however I would also need it to function normally. in, and outside of the specified program
So i don't need if-whatever pass it through, I need to ALWAYS pass it through. but only run the custom function I...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Yep that is exactly the issue.. Spacebar is the hotkey, that I want to trigger the script, however I would also need it to function normally. in, and outside of the specified program<br/>
<br/>
So i don't need if-whatever pass it through, I need to ALWAYS pass it through. but only run the custom function If the game is the focus.<br/>
<br/>
(IE in the game Im playing, pressing spacebar centers the camera on your character) (and the code, I want to add would center the mouse, click (on your character) and then move the mouse back to its original location.) <br/>
<br/>
I figured it wasn't possible currently, and would envision it to be a checkbox right next to  'key combination' thats labeled 'Pass HotKey Through'
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#7</link>
<pubDate>Mon, 08 Jun 2015 20:09:44 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#7</guid>
<category>DisplayFusion</category>
<description><![CDATA[To clarify, are you using the Spacebar as the hotkey that triggers this function? The problem with this is that when the script runs, it sends a space, but then DF picks that up again, and runs the script again, and so on, putting itself into a loop. At the moment, there's no way for the script t...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
To clarify, are you using the Spacebar as the hotkey that triggers this function? The problem with this is that when the script runs, it sends a space, but then DF picks that up again, and runs the script again, and so on, putting itself into a loop. At the moment, there's no way for the script to say "if whatever, just pass the hotkey through and exit the script." However, I'll see if this is something we could add.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#6</link>
<pubDate>Sun, 07 Jun 2015 09:48:17 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#6</guid>
<category>DisplayFusion</category>
<description><![CDATA[I don't know. I own DF just a few days. Maybe a Dev answers you.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I don't know. I own DF just a few days. Maybe a Dev answers you.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#5</link>
<pubDate>Sat, 06 Jun 2015 20:32:59 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#5</guid>
<category>DisplayFusion</category>
<description><![CDATA[So there's no way to send the keypress past display fusion? I couldn't even type the spaces in my last post while the script was active (even outside of firefox) Like disabling the function for .1 seconds, send it, and re-enable the function?]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
So there's no way to send the keypress past display fusion? I couldn't even type the spaces in my last post while the script was active (even outside of firefox) Like disabling the function for .1 seconds, send it, and re-enable the function?
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#4</link>
<pubDate>Sat, 06 Jun 2015 20:28:16 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Space is still send with this function. But it always executes this script.
It you want to use something like this in a game, i suggest you use another program. Don't know what's available. I own a Logitech Gaming Mouse and Keyboard with extra buttons, that i can assign scripts to. That works mu...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Space is still send with this function. But it always executes this script.<br/>
<br/>
It you want to use something like this in a game, i suggest you use another program. Don't know what's available. I own a Logitech Gaming Mouse and Keyboard with extra buttons, that i can assign scripts to. That works much better than redirecting normal keys.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#3</link>
<pubDate>Sat, 06 Jun 2015 08:53:53 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks.that.solves.1.of.the.problems.now.i.still.need.to.be.able.to.use.the.space.bar.outside.and.inside.of.firefox.or.whatever.program.i.choose]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks.that.solves.1.of.the.problems.now.i.still.need.to.be.able.to.use.the.space.bar.outside.and.inside.of.firefox.or.whatever.program.i.choose
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#2</link>
<pubDate>Sat, 06 Jun 2015 08:26:53 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Try this:
Code
Copy
Select All
using System;
using System.Drawing;
// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Window Location target when run by a Window Location rule
//   - TitleBar Button owner when run by a T...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Try this:<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="#code019e55a321e2703dae6fc152f2f72fb8" 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('code019e55a321e2703dae6fc152f2f72fb8Js'); 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="code019e55a321e2703dae6fc152f2f72fb8Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Window Location target when run by a Window Location rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
//if we failed to get the focused window, exit the function
if (windowHandle == IntPtr.Zero)
return;
//check if it's the correct window. using the Window-Title.
if ( BFS.Window.GetText(windowHandle).Contains("Firefox") )
{
int startX = BFS.Input.GetMousePositionX();
int startY = BFS.Input.GetMousePositionY();
BFS.Input.LeftClickMouse();
BFS.Input.SetMousePosition(960, 540);
BFS.General.Sleep(10);
BFS.Input.LeftClickMouse();
BFS.Input.SendKeys(" ");
BFS.General.Sleep(10);
BFS.Input.SetMousePosition(startX, startY);
}
else
{
BFS.Input.SendKeys(" ");
}

}
}</pre><textarea id="code019e55a321e2703dae6fc152f2f72fb8" name="code019e55a321e2703dae6fc152f2f72fb8" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>Help with Custom Function</title>
<link>https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165</link>
<pubDate>Fri, 05 Jun 2015 12:08:12 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/help-with-custom-function/?ID=bde5e4a9-a929-4f09-a85f-f3b4bbb6c165</guid>
<category>DisplayFusion</category>
<description><![CDATA[So Im trying to make a function/macro that occurs when I press the space bar. There are 2 issues
1 I only want it to run when a specific game is the focus
2 Space-bar does something in the game, and I would like it to continue to work (so I need the function to disable itself, pass the hotkey t...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
So Im trying to make a function/macro that occurs when I press the space bar. There are 2 issues<br/>
1 I only want it to run when a specific game is the focus<br/>
2 Space-bar does something in the game, and I would like it to continue to work (so I need the function to disable itself, pass the hotkey through, and then re-enable)<br/>
<br/>
Heres what I have sofar:<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="#code019e55a321f8723ca9a03b0bc7076670" 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('code019e55a321f8723ca9a03b0bc7076670Js'); 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="code019e55a321f8723ca9a03b0bc7076670Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
int startX = BFS.Input.GetMousePositionX();
int startY = BFS.Input.GetMousePositionY();
BFS.Input.LeftClickMouse();
BFS.Input.SetMousePosition(960, 540);
BFS.General.Sleep(10);
BFS.Input.LeftClickMouse();
BFS.Input.SendKeys("");
BFS.General.Sleep(10);
BFS.Input.SetMousePosition(startX, startY);

}
}</pre><textarea id="code019e55a321f8723ca9a03b0bc7076670" name="code019e55a321f8723ca9a03b0bc7076670" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>