Jump to content
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


simcheck_sig_banner_devteam.jpg

 

Bj

Share this post


Link to post
Share on other sites
Guest bartels

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


simcheck_sig_banner_devteam.jpg

 

Bj

Share this post


Link to post
Share on other sites
Guest bartels

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


simcheck_sig_banner_devteam.jpg

 

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...