Jump to content
The simFlight Network Forums

trouble programming hotkey

Recommended Posts

I've been trying to get an external program to detect when the ` key is pressed during a FS2004 session using FSUIPC.

Currently, when I hit the ` key, the external program doesn't detect this key press.

Here's how my code is set-up in visual C:

unsigned long hotkey;




Read 0x320c to find next open hotkeyslot - in this case, it is 0x3210

hotkey = 0x000000DF;

FSUIPC_Write(0x03210, 4, &hotkey, &dwResult);





In my main program loop

char tempchr;

FSUIPC_Read(0x3213, 1, &tempchr, &dwResult);

Currently, when I press the ` key tempchr always reads zero.

Did I missing something in my code?

Thank you for your help.

Link to comment
Share on other sites

Currently, when I hit the ` key, the external program doesn't detect this key press.

I assume there's an FSUIPC_Process somewhare after the Read? If so, there are only two possible answers as far as I can see. Either

1) FS doesn't have the focus when you press the key. FSUIPC is only receiving whatever FS is receiving, it isn't a universal hot key.


2) The key you have as ` isn't the same as on my keyboard. It's one of the keys which varies. Try programmimg something more standard first. If thast works, you need to find out what keycode your ` key gives. You could do that, for example, by programming the key in FSUIPC's Keys page then checking the code in the INI file.

There is one other possibility, and that is a programming error, but from what you privide here that seems unlikely. You can check this quite easily, however, in FSInterrogate. Write your 000000DF to 3210, return focus to FS whilst FSInterrogate s scanning that DWORD, press ` and see the DWORD change to 010000DF.

If you want me to check the actions between your program and FSUIPC, please log IPC reads and writes and show me an extract.



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.