I can’t figure-out how to get tab-key working properly on Mac under Juce, and am puzzled that there aren’t other reports on the forums about this… well weird!
Basically, I can’t use the tab key to move focus around on the Macs [but this works fine on the Windows boxes]. As a simple example, I have some text components in a container. If I set a breakpoint in
I find that the key code when pressing the tab key is “9” and this fails to match against KeyPress::tabKey which has a value of “113”. So either the tab key press is generating the wrong value, or the KeyPress::tabKey value is mis-assigned. Very strange!
Same basic problem doing shift-tab (where we’d expect focus to move the other way…)
This is true on intel and PowerPC macs, with a variety of keyboards.
I bump cause an impossibility to use tab…
For instance in a KeyPress::keyPressed :[quote] if(key == KeyPress(KeyPress::tabKey))
{
flipToNetExplorer();
return true;
}
if(key == KeyPress(KeyPress::returnKey)) {
m_addButton->triggerClick();
return true;
}[/quote]
return is usable, tab is not.
Is the presence in the component of a TextPropertyComponent problematic ?
What happens is that when a comp is focused, and you press tab, then if the focus successfully moves to another component, then the tab key is thrown away… If nothing happens (e.g. if none of the components want focus or if their createFocusTraverser() returns 0), then the tab key is allowed through as a normal keypress.