Wish: Could use the "TAB" key with GUI elements...

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Wish: Could use the "TAB" key with GUI elements...

Post by christianclavet »

Hi,

I tried to use the TAB key in a custom GUI element (kind of code editor), and each time the only thing that seem to work is a focus change.

I looked at the source and it seem that the KEY is dedicated to focus change. Nothing will change that behavior unless we modify the source...

Would be really nice that the key checking could be disabled by a flag (boolean) that would tell that the currently focused element would "forbid" a focus change. So we could use the key inside our GUI Element. Perhaps something like this:

Code: Select all

GUIElement->setNoFocusChange(true);
Right now, the only way I will be able to use that key is to modify the source and I can't do that with my current project.

So I'll keep that as a wish... :)
Last edited by christianclavet on Fri May 27, 2011 3:44 pm, edited 2 times in total.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I guess it would makes sense checking for focus after the element has handled the event and not before that. Then you can just return true in the event-receiver for the tab-key to mark it as handled. I have to check if this conflicts with any of the existing elements, but I don't think so.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Seemed to work. It's in svn trunk r3757
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks CuteAlien!
Post Reply