pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@gmail.com>
Subject Re: KeyListeners on ImageView
Date Wed, 09 Mar 2011 13:02:18 GMT
On 9 March 2011 19:16, Greg Brown <gk_brown@verizon.net> wrote:

> The problem appears to be the handling of keystrokes when no component has
> the focus (i.e. the focused component is null). I agree that sending
> keystrokes to the display in that case makes sense.
>

Greg,

If there are multiple Displays, and no Component has the focus, which
Display would receive the keystrokes?

Is ApplicationContext aware of which AWT Window and therefore Pivot Display
that the keyboard event originated from? (I'm not a a dev machine to check)

If not perhaps iterating over ApplicationContext's internal list of Displays
and sending to the one (if there is one) whose parent java.awt.Window
returns true from isActive()?  I am clueless about AWT so perhaps there are
scenarios where this would not work.

Another option might involve a ComponentClassListener which would track the
Display which most recently had a focused Component.  If there is no focused
Componet, and the most recently focused Display still exists, it might
receive the keyboard events (perhaps after the java.awt.Window#isActive()
logic above).

Chris

Mime
View raw message