Neoforce ControlsNeoforce ControlsDiscussionsDiscussionsSuggestionsSuggestionsInput SystemInput System
Previous Previous
 
Next Next
New Post
 9/28/2009 8:25 PM
 

You should provide a way to know if an input event has been handled by the gui system.

 

New Post
 9/28/2009 9:34 PM
 

You can very easily go thru the first level controls collection and check their position and visibility and if needed check focus for keyboard or gamepad events.


Tom Shane
New Post
 10/7/2009 3:30 AM
 

I have my own input system, and I second Ryann's reply. You just need to loop through all the elements to assign focus, and if none of them are clicked on, assign focus to a ghost window and then hide it. That will remove focus from all of the elements that are visible. Then just do your normal input detection. Otherwise, turn your 'keypressed' variable to false.

 

Something like that.

New Post
 3/6/2010 8:48 PM
 
Ryann wrote:

You can very easily go thru the first level controls collection and check their position and visibility and if needed check focus for keyboard or gamepad events.

This is not that simple with controls going outside of their parents rectangle. This happens for example when putting a Console on a Window and Anchoring it with All; the dropdown containing the channels will be outside of the window's rectangle.

This library is so extensive that to me it is the de-facto standard for XNA UI controls but this 'minor' issue makes it impossible for me to use and superimpose it on top of my gameplay screen.
If there is another workaround that covers this case, I would love to hear about it. If not, here's another vote to put the feature into the awesome library that it is

New Post
 3/6/2010 10:33 PM
 
 Modified By Ryann  on 3/6/2010 11:33:25 PM
You are right, the scenario you described makes this approach not fully working. If you want to be really sure you can go thru all controls recursively. If you are not using a lot of controls, there will not be a performance hit.

Anyway, I will try to come with more user-friendly solution soon.

Tom Shane
New Post
 3/9/2010 8:27 PM
 
 Modified By Ryann  on 3/9/2010 9:28:28 PM

This could help with deciding if you should continue processing your input.

http://tomshane.cz/neoforce/Forums/ta...


Tom Shane
Previous Previous
 
Next Next
Neoforce ControlsNeoforce ControlsDiscussionsDiscussionsSuggestionsSuggestionsInput SystemInput System