- Messages
- 158
- Country

Fellow developers,
My project involves an FMC-like gauge. I'm working on the option to allow the player to use his own keyboard to control it vs. clicking on key images on the screen. This involves using DirectX DirectInput, and thanks to the sd2gau28 C gauge writeup, and various tidbits of sample code from around the net I have the input side working fine and dandy, in both FS9 and FSX (even though the sd2gau28 says their technique doesn't work in FSX I think that was for DX3 and we're on DX9 now).
The problem is that the keystrokes also go on into FS too. When the player hits F1 on my gauge to login it works, but the F1 also goes into FS and sets the throttles to zero, and so on.
Does anyone know the magic incantation to temporarily shut off keyboard input to FS so I can intercept the keys all for myself?
I know this can be done...the PMDG 737 FMC does it as does the iFly 747-400 and I'm sure many others.
This same question was asked at least 3 times on the Avsim forums over the last few years and never answered although there were hints this way and that. Someone even said "you can do it but it's complex" and left it at that! Grrrrrr. Don't tease me like that
Reassigning keys isn't the answer...I need the whole keyboard or at least the letters, numbers, and function keys.
The only thing I can think of offhand is to hook the FS message loop and intercept keys with WM_KEYDOWN when I want to and allow them through when I'm done.
Any thoughts? Any ideas helpful.
Dutch
My project involves an FMC-like gauge. I'm working on the option to allow the player to use his own keyboard to control it vs. clicking on key images on the screen. This involves using DirectX DirectInput, and thanks to the sd2gau28 C gauge writeup, and various tidbits of sample code from around the net I have the input side working fine and dandy, in both FS9 and FSX (even though the sd2gau28 says their technique doesn't work in FSX I think that was for DX3 and we're on DX9 now).
The problem is that the keystrokes also go on into FS too. When the player hits F1 on my gauge to login it works, but the F1 also goes into FS and sets the throttles to zero, and so on.
Does anyone know the magic incantation to temporarily shut off keyboard input to FS so I can intercept the keys all for myself?
I know this can be done...the PMDG 737 FMC does it as does the iFly 747-400 and I'm sure many others.
This same question was asked at least 3 times on the Avsim forums over the last few years and never answered although there were hints this way and that. Someone even said "you can do it but it's complex" and left it at that! Grrrrrr. Don't tease me like that
Reassigning keys isn't the answer...I need the whole keyboard or at least the letters, numbers, and function keys.
The only thing I can think of offhand is to hook the FS message loop and intercept keys with WM_KEYDOWN when I want to and allow them through when I'm done.
Any thoughts? Any ideas helpful.
Dutch
Last edited:
