Sign in to follow this  
bcs112

How to stop FS from reading keyboard input ?

Recommended Posts

Hi again,After some hours searching and with the help from Arne, I was able to get DirectInput working and I now have a gauge which reads keyboard presses directly in FS. For some reason the inputs are read in Querty format while I have an Azerty keyboard but OK, I can live with that.Now, the gauge I am making actually has a very simple purpose, it's a gauge with 2 String elements which can contain 7 characters: the aircraft registration and the flight number. These values are written to a small text file so they don't need to be updated every time the panel is restarted. I have programmed the gauge so that when the text area is clicked it will capture the keyboard inputs and write to the string element, so far this parts works perfect but... FS continues to also monitor keyboard inputs and for instance when you type an "S" the view changes, etc...How can I temporarily stop this from happening (as long as the text is captured by my gauge) ? I would think that I somehow need to capture the keypress and send a NO_KEY in stead or something, but I have no idea how to do that. It must be possible since all those FMC gauges can do it ! Or are they using a completely different technique for keypress capture ?Thx for the help,Bj

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Sorry about the qwerty keyboard, I just use mine to determine the #defines for the keys, and aI have a qwerty keyboard. "My" way to use keys without interfering with FS is, to use key combinations like AltGr+'key'. Sufficient for FMC inputs.Arne Bartels

Share this post


Link to post
Share on other sites

Arne, How do you read the altgr+another key ? When I look at the raw keypressed codes when both AltGr and another key is pressed then only the AltGr code is shown...Bj

Share this post


Link to post
Share on other sites

Use #define KEYB_ALTGR 0xb8....key=ReadDirectInputKeyboard( .. ,KEYB_ALTGR);Arne Bartels

Share this post


Link to post
Share on other sites

Arne,I tried setting the SetCooperativeLevel to DISCL_EXCLUSIVE and DISCL_FOREGROUND but for some reason this doesn't work. Any ideas how this can be resolved ?Bj

Share this post


Link to post
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
Sign in to follow this