July 30, 200619 yr 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 :)
August 1, 200619 yr 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.
August 1, 200619 yr 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.
August 1, 200619 yr >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.
August 1, 200619 yr >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.
August 1, 200619 yr 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.
August 1, 200619 yr Commercial Member sd18gau.zip. ATM I can't remember who supplied me with the original information but it's in there, along with an acknowledgement.-Dai
August 2, 200619 yr Commercial Member >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 AviationMy Playland - I69
August 6, 200619 yr >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
August 8, 200619 yr I already use your code, but the document clearly states:"I have to sound a note of caution though; if you
Create an account or sign in to comment