Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
DLTest
5 discussion posts
I've just started using the software (on a Windows 10 machine with dual monitors). I have no idea if this functionality already exists or whether it would be very difficul to implement. Any help appreciated!
Typically, I'd open a new window for a program in the taskbar using Windows + number. It doesn't matter much where the mouse appears in the window (near the top left for preference).
Oct 8, 2021 (modified Oct 8, 2021)  • #1
User Image
DLTest
5 discussion posts
It seems like I can define a second Windows + key (e.g. Win + [) to
"Move Mouse Cursor to Centre of Active Window".
So is it possible to create a single hotkey to carry out the two consecutively e.g Win + 1 followed by Win + [.
And the same for other digits!.
Oct 8, 2021 (modified Oct 9, 2021)  • #2
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

If you create a scripted function in DisplayFusion (DisplayFusion Settings > Functions > Scripted Function > Add Scripted Function), you can use this line to send key combinations: BFS.Input.SendKeys("");

As you type in that line, it should prompt you for the keys you want to send in the quotations. You can then add a hotkey to the script.

Hope that helps!
Oct 8, 2021  • #3
User Image
DLTest
5 discussion posts
Thaks Owen,
I'll try that.
Donal.
Oct 8, 2021 (modified Oct 9, 2021)  • #4
User Image
DLTest
5 discussion posts
Thanks Owen - works perfectly.
So now I have ({WIN} + digit from numeric keypad) as a shortcut for my Taskbar programs. For example, {WIN} + 1 sends {WIN}({VK_49}){WIN}({VK_219}) where VK_219 is invariant but VK_49 changes for each program.
The natural next step would be to pass the digit VK_49 as a parameter rather than having a separate scripted function for each digit.
I see that parameters can be passed in Triggers and Custom Functions but that doesn't seem to be available in Scripted Functions. It doesn't seem like I can just replace my Scripted Function with a Custom Function.
Any suggestions appreciated.
Donal.
Oct 9, 2021  • #5
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hello,

It would likely be easier if you wrapped the whole thing into one scripted function. Here's an example using chrome:

Code

BFS.Application.Start("C:\\ProgramFiles\\Google\\Chrome\\Application\\chrome.exe", "");
IntPtr window = BFS.Application.GetMainWindowByFile("*chrome.exe*");
BFS.Window.Focus(window);
BFS.DisplayFusion.RunFunction("Move Mouse Cursor to Centre of Active Window");


Let me know if that works for you.

Thanks!
Oct 12, 2021  • #6
User Image
DLTest
5 discussion posts
Thanks Owen, I'll check it out.
I'm currently using a trigger
which allows me to open a taskbar app or scroll through the open windows and offset the mouse cursor a lttle from the top left corner.
That seems to do pretty much what I want - may need some tweaking.

Code

public static void Run(IntPtr windowHandle)
{
// Get the window's current bounds.
Rectangle currentWindowBounds = BFS.Window.GetBounds(windowHandle);
// Move mouse offset from Top Left.
BFS.Input.SetMousePosition(currentWindowBounds.X + currentWindowBounds.Width/20, currentWindowBounds.Y + currentWindowBounds.Height / 20);
}
• Attachment [protected]: Trigger.jpg [75,387 bytes]
Oct 12, 2021  • #7
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)