Jump to content
Sign in to follow this  
Guest wysspeter

Keyboard Input in C Gauge

Recommended Posts

Guest wysspeter

Hi,I need a way to read keyboard input in my C gauge. I managed to do this with DirectInput, but the problem is that Flightsim receives the key too. So if I need key 'L' my gauge reacts but FS switches the light on or off.Is there a way to block the keys, so they don't get through to the FS? Just like all the FMC do :)

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

Well, you can intercept the keyboard completely, but this is complex.An easy solution would be to un-assign that key in FS. A better solution would be to use the registered version of FSUIPC to handle your key assignment needs as it will allow you to have them only handled by FSUIPC if you so desire.

Share this post


Link to post
Share on other sites
Guest wysspeter

Well, I need all keys (text input) so unassign is not an option.But I would be interested in the "intercept" method. It doesn't matter if it's complex.

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

>Well, I need all keys (text input) so unassign is not an>option.Not sure what you mean. If your gauge uses the "L" key, then go into FS's Settings Assignments dialog and unassign it from the panel lights. Now FS sees it, but does nothing.>But I would be interested in the "intercept" method. It>doesn't matter if it's complex.Well, see the problem is that your gauge is a .dll running under FS, so your gauge is a part of FS. So the best way to do this without writting your own IPC or module would be to use FSUIPC.The only other thing I could think of would be to intercept the Windows Messages before they get to FS (like what FSUIPC can do), and this would require you to use WIN32 API stuff. You'd have to create your own message handling loop, intercept and handle all windows messages, dispatching ones you aren't interested in to FS's handler, and processing the ones you are looking to use.So, to do this, you'll need to start on MSDN with learning about windows messages and dispatching.Good luck.

Share this post


Link to post
Share on other sites
Guest wysspeter

>Not sure what you mean. If your gauge uses the "L" key, then>go into FS's Settings Assignments dialog and unassign it from>the panel lights. Now FS sees it, but does nothing.My gauge needs all keys while the keyboard input is active. Just like most of the payware FMC do. First you click on a button, and then every key goes into the FMC instead of the FS. Then you click the button again and keyboard input is disabled, so FS can use the keys again.

Share this post


Link to post
Share on other sites
Guest bartels

One possibility: use a XML gauge with a section, switch the locking of the keyboard with ... (M:Key) chr ....Or use unused key combination e.g. AltGr+Key.

Share this post


Link to post
Share on other sites

sd18gau.zip. ATM I can't remember who supplied me with the original information but it's in there, along with an acknowledgement.-Dai

Share this post


Link to post
Share on other sites

>sd18gau.zip. ATM I can't remember who supplied me with the>original information but it's in there, along with an>acknowledgement.>>-Dai>FYI, your example doesn't compile with the current DirectX version.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
Guest Mathias

>sd18gau.zip. ATM I can't remember who supplied me with the>original information but it's in there, along with an>acknowledgement.>>-DaiDai, good to see you're still around!!! That would have been me in conjunction with Arne B. who got me started on this keyboard stuff. Can't help however concerning the non-compilation in more modern environments than my old but trusted VC++6.0

Share this post


Link to post
Share on other sites
Guest wysspeter

I already use your code, but the document clearly states:"I have to sound a note of caution though; if you

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...