Bill, Have a look at the StockTracker example which demonstrates using ActionMappings to bind KeyStrokes to Actions for a Window. http://pivot.apache.org/tutorials/stock-tracker.html http://svn.apache.org/repos/asf/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/
Other info... http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Window.ActionMapping.html http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Keyboard.KeyStroke.html http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Action.html http://pivot.apache.org/tutorials/menu-bars.html It is also possible to add ComponentKeyListeners to a Display object. http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java Chris On 3 March 2011 09:18, Bill van Melle <[email protected]> wrote: > Wow, this thread arrived just in time for the related question that I just > ran into. As best I can tell, Window has the same problem -- it's a > container, and hence not focusable. That seems to mean that if I want to > have any global keyboard shortcuts, I have to go implement a FocusableWindow > and FocusableWindowSkin, right? This seems wrong somehow, especially since > top-level windows have a very well-known sense of focus bestowed by the > window system. Why should everyone have to roll their own? Am I missing > anything? > > (Well, looking at your example, I see that > implementing Application.UnprocessedKeyHandler might do the trick for the > top-level app, but what if I generate additional top-level windows and want > them to have shortcuts, such as Esc to close them?) >
