pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Problem with Keystrokes not getting registered.
Date Fri, 15 Oct 2010 11:58:48 GMT
In order for a keystroke to be processed, a component must have the focus to receive the key
event and propagate it up the component hierarchy to the window. Easiest way to handle this
is to call requestFocus() on the window immediately after you open it.

On Oct 15, 2010, at 6:56 AM, Abbas Hussain wrote:

> Hello All.
> New to using Apache Pivot. Seems interesting and I am evaluating it for a new project
we are about to start. I have the following wtkx defined:
> <Frame title="4SiJte" maximized="true"
>         styles="{showWindowControls:false}"
>         xmlns:wtkx="http://pivot.apache.org/wtkx"
>         xmlns:content="org.apache.pivot.wtk.content"
>         xmlns="org.apache.pivot.wtk">
>     <actionMappings>
>         <Window.ActionMapping action="loginAction" keyStroke="CTRL-L" />
>     </actionMappings>
>     <menuBar>
>         <MenuBar>
>             ...
>                 <Menu.Item action="loginAction">
>                      <buttonData>
>                            <content:MenuItemData text="Login" keyboardShortcut="CTRL-L"
>                      </buttonData>
>            ...
>     </menuBar>
> I am reading it in to a Window, however, when I click on the action through the menu
item the action gets invoked, but pressing CTRL+L has no effect. Any thoughts? I read through
the tutorial but I am not sure what I am missing here. The MenuBar tutorial seems to work
fine and I am not sure what I am doing differently.
> On a different but related note, how do I setup menu accelerator keys? For instance how
pressing ALT+F usually shows the File menu in most apps.
> Thanks,
> A.Hussain.

View raw message