Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Ferro Giconi
7 discussion posts
I am having trouble making a scripted function that presses Win+Tab. My goal is to set the DisplayFusion taskbar to have a shortcut to the scripted function, which I figure should give me what is essentially the Task View button since it isn't currently supported by the DisplayFusion taskbar.

From some googling, I figured this should work, but it doesn't seem to. Any ideas what I've done wrong?

Code

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger 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)
    {
        BFS.Input.SendKeys("{VK_LWIN}({VK_TAB})");
    }
}
Jul 2, 2023  • #1
User Image
JLJTGR
94 discussion posts
I'm not sure how you came to that string. This is the one that is generated for me and seems to work:

Code

BFS.Input.SendKeys("{WIN}({VK_9})");
Jul 2, 2023  • #2
User Image
Ferro Giconi
7 discussion posts
Thanks, that worked!

I came up with those key codes by looking up the VK keyboard codes which brought up a Microsoft page with VK codes for all the keys. I had incorrectly assumed those must be what I need after seeing VK codes for other keys being used in examples for DisplayFusion.

I saw it mentioned that I could get it to generate those key combinations for me, however I was having trouble figuring out how. I did just figure it out now though. It only works if I use the "Insert BFS Code" button instead of manually typing out the line.
Jul 2, 2023  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)