get user input

Started by
3 comments, last by FGFS 10 years, 6 months ago

Hi

in my x-plane plugin I can get user input but it's not usable as for ex. P -> pause the game etc.

Any way to get user input somehow else? I had a look at sdl but it seems to need a init_video.

Something alike: http://anttweakbar.sourceforge.net/doc/

would be cool.

But I cannot figure how to integrate it into my already existing opengl app (x-plane plugin).

I have it drawn but not responding to user input.

Many thanks for help

Advertisement

You should look at the X-plane SDK.

a keysniffer should be able to get all input for you and allow you to prevent the key from being passed on to other plugins or x-plane if you wish to do so.

http://www.xsquawkbox.net/xpsdk/mediawiki/XPLMDisplay

If your plugin has a window you should be able to use XPLMHandleKey_f to get input while your window is focused.

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Thanks, I saw that but the example below doesn't get focus or alike as pressing p pauses the sim. Any help?

http://www.xsquawkbox.net/xpsdk/mediawiki/KeySniffer

Thanks, I saw that but the example below doesn't get focus or alike as pressing p pauses the sim. Any help?

http://www.xsquawkbox.net/xpsdk/mediawiki/KeySniffer

if you return 0 from your handler function it should stop the keypress from being passed on to x-plane.

It doesn't look like you need or even want a keysniffer though, it would probably be better to have a widget for the input and give it focus using: XPSetKeyboardFocus when a hotkey is pressed.(you can remove focus using XPLoseKeyboardFocus once you're done with it)

if you want to have your plugin capture all input all the time it would be impossible for a user to pause the sim (unless your plugin is able to somehow determine if the "P" keypress was intended for the plugin or for x-plane and return the appropriate value).

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Overlooked that, thanks.

This topic is closed to new replies.

Advertisement