Jump to content
The simFlight Network Forums

Autohotkey's not detected by FSUIPC in background mode


Recommended Posts

I'm trying to get Autohotkey to send key presses to FSUIPC while FSUIPC is running in the background. I'm sending from AHK to FSUIPC using ControlSend and the FSUIPC PID. It's not receiving them. But if I select "Show" from the FSUIPC taskbar icon and the little window is visible then it now receives the Autohotkey keys - I can see it in the console. I don't want the FSUIPC window active when I'm playing FS2020. Any idea, please? Perhaps I need to tell AHK which ControlSend "Control" to use but that is a mystery to me so I'm leaving it blank at the moment.

Link to comment
Share on other sites

2 minutes ago, kooky45 said:

I'm trying to get Autohotkey to send key presses to FSUIPC while FSUIPC is running in the background. I'm sending from AHK to FSUIPC using ControlSend and the FSUIPC PID. It's not receiving them. But if I select "Show" from the FSUIPC taskbar icon and the little window is visible then it now receives the Autohotkey keys - I can see it in the console. I don't want the FSUIPC window active when I'm playing FS2020. Any idea, please?

Usually you would send key presses to the windows class name, not the pid, but thats another matter - maybe AHK gets the class name from the pid and uses that.
FSUIPC7 also picks up key presses from the FS when that has the focus, via SimConnect, so you could try sending the keypresses to MSFS instead.
However, this may nor work if using modifier keys, as although FSUIPC7 detects most (but not all) key presses via simconnect, it will scan  the keyboard to detect any modifiers (shift, ctrl, alt) when it receives the main key press/release.

Link to comment
Share on other sites

Thanks John, I can't send to MSFS since it doesn't detect most of the key presses from the device I'm using (it's a mini keypad that has rotary encoders instead of keys with the encoders sending keyboard characters when rotated). For some reason MSFS misses most of the characters while other tools like FSUIPC see all of them but only if they're sent directly to FSUIPC and not through the sim first. MSFS even misses the keys sent by AHK if they come from the encoders. There's something strange about the way MSFS is reading keyboard input and my encoder isn't sending keypresses exactly like a keyboard (it's flashed with QMK and I'm looking if that could be the problem too)!

The problem I'm trying to overcome using AHK is that I don't want to have to keep FSUIPC focused in the desktop to collect the keypad input, I'd prefer MSFS to be focused all the time, and I thought that AHK could intercept the encoder key presses and send them to them FSUIPC while it's in the background.

An alternative that sort-of-works is to have the FSUIPC open and it works fine but AHK moves focus to it when it sends the first key press and the focus won't reliably move back to the previous window.

Link to comment
Share on other sites

12 minutes ago, kooky45 said:

I thought that AHK could intercept the encoder key presses and send them to them FSUIPC while it's in the background.

Yes, this should be possible if its sending the keypress to FSUIPC as a windows event to the class name - it shouldn't need the focus.

Sorry, but I don't think there is anything I can do about this in FSUIPC. Maybe try AHK support to see if they can do anything for you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.