Skip to main content
Participating Frequently
July 21, 2010
Question

Having problem with Keyboard Event

  • July 21, 2010
  • 1 reply
  • 676 views

Hi,

First here is my application structure where TextFlow Layout object is added.

Main            -> Application
Canvas            -> Canvas
Canvas            -> Canvas
authorArea        -> Canvas
HBox            -> HBox
container        -> Canvas
Canvas            -> Canvas
tabNav            -> TabNavigator
author            -> Canvas
Module            -> Module (This is a SWF file that loads via interface IModuleInfo load method. This is not optimised for Main application)
VBox            -> VBox
Canvas            -> Canvas
HBox            -> HBox
VBox            -> VBox
HBox            -> HBox
VBox            -> VBox
stemContainer        -> Canvas
taStem            -> VBox
_textFlow        -> TextFlow

Now my problem is, when I have my focus set in _textFlow object and press Right/Left key from keyboard then the focus on TabNavigator also get changed from one tab to another. If this focus get changed and user pressthe space key the it jump to that particular tab.

can anyone have any suggestion to solve this issues.

Regards,

Amandeep Singh

This topic has been closed for replies.

1 reply

Inspiring
July 28, 2010


can you listen for the keyboard events on your vBox directly above the texflow and stop the propegation so they wont make it up the chain to your tab nav?

Participating Frequently
July 29, 2010

Thanx box86rowh for your help.

My problem was that when I use arrow key in Text Layout Framework, it listen to that event properly but its parent TabBar/TabNavigator also listen to the same. This creates problem when using arrow keys the tab focus change and user press "Space" or "Enter" key then the focus change from current tab to focused tab.

I have resolved this issue. What I did is I extended the ContainerControl class and override the keyDownHandler function of the class. In this function I send request the super function and the suppress (stopimmediatepropagation) the key event their. By doing this Text Layout Framework listen to the event and stop its propagation so that in bubble phase no other component listen to this event and do some function.

Thanx again for response.

Adobe Employee
July 30, 2010

What TLF does is call preventDefault on the handled events.  The other handlers are supposed to check isDefaultPrevented.  I gather that convention isn't being followed.

Richard