Jump to content
  • Advertisement
Sign in to follow this  
FGFS

OpenGL get user input

This topic is 2119 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

 

 

 

Share this post


Link to post
Share on other sites
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.

Edited by SimonForsman

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!