Multiple panels - focus handling
I'm using several panels to show one main UI and a couple of sub UIs located in the 3d world.
By clicking at elements, one element per panel is getting focus.
This gives strange behavior, for example, when entering text.
Is there any way to "De"-focus elements in the other panels?
By clicking at elements, one element per panel is getting focus.
This gives strange behavior, for example, when entering text.
Is there any way to "De"-focus elements in the other panels?
Re: Multiple panels - focus handling
There are three properties in NoesisGUIPanel (_enableKeyboard, _enableMouse and _enableTouch) that control the kind of inputs events that are active.
Could you try to enable and disable those properties to handle your scenario? If it works we could think a better way to expose it.
Could you try to enable and disable those properties to handle your scenario? If it works we could think a better way to expose it.
Re: Multiple panels - focus handling
That will maybe solve the event handling, but what about the visual effects of focusing?
Re: Multiple panels - focus handling
Yes, we need a new function to "unfocus" a panel. Please, try the solution I gave you and if everything is right we will improve the API to support this in a clean way.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Multiple panels - focus handling
Can't be done directly, but you can do it with current API:
This should do the trick
Code: Select all
void ClearFocus(NoesisGUIPanel gui)
{
var content = (UIElement)gui.GetContent();
var keyboard = content.GetKeyboard();
keyboard.Focus(null);
}
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 20 guests