Official support for Tab, Shift+Tab

Create issue
Issue #113 wontfix
Former user created an issue

Automatic migration. Original reporter: "Xirnohn"

My approach: New Property for Window: TabOrder. Its and int, if its 0, than its not selectable with tab/shift+tab.

WinA - 2

-WinB - 1
-WinC - 5
-WinD - 15
-WinE - 10

If the active window is WinA, then the order are when we press tab(st least 4 times): WinC, WinE, WinD. Now the WindD the active window, pressing Shift+Tab the order are: WinE, WinC, WinA, WinB.

In System::injectKeyDown intercept the Tab and Shift+Tab when Tab pressed: get the next higer TabOrdered window's TabOrder value, then activate it: int tabOrder = 0;

get the current TabOrder value if (d_activeSheet->getActiveChild() != NULL) tabOrder = d_activeSheet->getActiveChild()->getTabOrder(); else tabOrder = d_activeSheet->getTabOrder();

get the next bigger TabOrder value what is present int newTab = d_activeSheet->getNextTabOrder(tabOrder);

if the selections returns true, then new window selected, the Tab key handled, we return from the injectKeyDown if (d_activeSheet->selectNextWindowWithTab(newTab)) return true;

Same with Shift+Tab.

Its can be integrated to the LayoutEditor and i think its better then create a new class to handle this functionality like the TabNavigation class in the wiki:

Reproducibility: always

Comments (6)

  1. Paul Turner

    The implementation of this (and the related tickets) will form part of a generic, but extendable, keyboard interface for CEGUI::Window class; what this means is that we will not simply detect the Tab key in the Window class and react to it, but rather allow much finer grained control over the whole keyboard interface to widgets, via some form of abstracted component.

    Another part of the implementation will utilise a new, but as yet undefined, system of 'unified' rendering states for all window types (by this I refer to the rendering states used by the falagard window renderers in deciding which imagery to draw).

    I have been mulling over the design for this feature, off and on, for quite some time. Once 0.5.0 final is out, I will make some attempt to complete, and finally reveal, my final suggested design for this feature; with the possibility of it being incorporated into the 0.6.x line of CEGUI code.

  2. Former user Account Deleted

    Original reporter: Xirnohn

    Thx Eddie for the reply. I understand that its need a more generic solution, but i upload a patch and i hope its go into the core(at least for 0.5.x). I think 0.6.x are far away, but Tab support and default actions with keys a must in a complex gui. Sometimes people dont have time to wait(and i dont have too).

  3. Paul Turner

    Thanks for the patch.

    I will say that it's unlikely to go into the core system. The reason for this is that knowing what the big plan is, adding this to the core system with the sole intention of removing it some weeks later would be particularly bad form; although we are certainly not averse to making breaking changes, I don't think anything has previously been put into the system with the actual *intention* of breaking it later (which is what would be happening if the patch was committed).

    I appreciate that this note sounds somewhat negative, but that is not my intention. I do not wish in any way to discourage community contributions, however it is important to avoid either wasted or duplicated effort where possible.

    Having said this, I do appreciate that people have projects they are working on and, as you say, are not always able to wait. So, for those people your patch will exist until such time that my vision for this feature comes to realisation.

    Please feel free, in the mean time, to publicise the availability of this patch in any way you wish :)

  4. Former user Account Deleted

    Original reporter: Xirnohn

    Hi Eddie.

    I dont feel your reply negative. I accept and understand your arguments. I just dont want patch every release with my additions, but its truly just my problem and its not a good argument to apply this patch.


  5. Former user Account Deleted

    Original reporter: aymen

    Patch works well for CEGUI 0.6 I implemented it first for Remote control then adapted to Keyboard, it support also the button hover status when a button get focus or lose it and u can fire the button event if the Enter button is hit

    I used :

    Key Pad 7 key as Tab Key Pad 4 key as Shift-Tab Key Pad 0 key as Enter

    I didndt use Tab Key because with DirectFB, I get those buttons thru System::injectChar and I get an error somewhere, so I just used System::injectKeyDown. but too easy to change it, just take a look on the code and make fit to ur needs.

    Thank You

  6. Lukas Meindl

    This should be largely resolved by timotei's GSOC 2013 project that has been integrated into default/v0

  7. Log in to comment