Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Rexatelis
4 discussion posts
Hi,

I want an hotkey to get passed to other applications after or while reacting with a scripted function on it.

For example I define an hotkey like "ctrl+w". When pressing the hotkey a scripted function of DisplayFusion gets executed. After that or at the same time I want the hotkey to get passed to other applications. So for example a frontmost browser tab would be closed and the scripted function would be running in the background.

Is this possible? Or is there a workaround to achieve this?

Thank you very much and best regards

Rex
Dec 20, 2017 (modified Dec 21, 2017)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
There isn't a way to use the same hotkey, no. Windows detects the keypress and tells DisplayFusion that it was detected, then DisplayFusion just runs whatever was assigned to that keypress.

However! If you just need to use it for your browser tab scenario, you can have the script send Ctrl + F4 to close the tab, like this:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// your code here

// Send Ctrl + F4 to close the tab
BFS.Input.SendKeys("^({VK_115})");
}
}


Hope that helps!
Dec 21, 2017  • #2
User Image
Rexatelis
4 discussion posts
Thank you for your answer! Unfortunately this doesn't help because closing a browser window was just an example.

From programming in C and C++ I know you are able to filter system events like key presses and choose if you want other applications to get this event as well.

I my case I want to define a hotkey/shortcut for a specific application if it's frontmost only. If any other application is frontmost, DisplayFusion should do nothing. At the moment I have this:

Code

using System;
using System.Drawing;

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        uint appId = BFS.Application.GetAppIDByWindow(windowHandle);
        string appPath = BFS.Application.GetMainFileByAppID(appId);
        //BFS.Dialog.ShowMessageInfo(appPath);
        if (appPath.EndsWith("\\notepad++.exe"))
        {
            // do my stuff
        }
    }
}


But this blocks the choosen hotkey for other applications. Do you also have a workaround for this?
Dec 21, 2017 (modified Dec 21, 2017)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Global hotkeys can't do that, for that we would need to be using keyboard hooks. We may change to keyboard hooks at some point in the future, so if we do, we'll be sure to let you know.

Thanks!
Dec 22, 2017  • #4
User Image
Rexatelis
4 discussion posts
Ok, I see. Thanks anyway and please make a big announcement when introducing the feature some day ... :)
Dec 22, 2017  • #5
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)