Jump to content

  • Log In with Google      Sign In   
  • Create Account


get user input


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 FGFS   Members   -  Reputation: 180

Like
0Likes
Like

Posted 02 October 2013 - 12:32 AM

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

 

 

 



Sponsor:

#2 SimonForsman   Crossbones+   -  Reputation: 5804

Like
2Likes
Like

Posted 02 October 2013 - 12:43 AM

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, 02 October 2013 - 12:45 AM.

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!

#3 FGFS   Members   -  Reputation: 180

Like
0Likes
Like

Posted 02 October 2013 - 01:27 AM

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


Edited by FGFS, 02 October 2013 - 01:41 AM.


#4 SimonForsman   Crossbones+   -  Reputation: 5804

Like
0Likes
Like

Posted 02 October 2013 - 02:24 AM

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


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!

#5 FGFS   Members   -  Reputation: 180

Like
0Likes
Like

Posted 02 October 2013 - 03:22 AM

Overlooked that, thanks.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS