I prefer option 1 although I also see advantages in option 2. I see
the need to poll the keyevent according to some timer resolution
(50ms) for jME but I am not sure what effect option 2 could have on
the other key bindings (AWT/JOGL and plain LWJGL) so that I would
suggest to handle all irregularities that are binding dependent in the
specific event handling class.
The bindings (JOGL, LWJGL, jME) have quite a different concept to
handle key events. This is also why I havent gotten the time to
implement the repetition of keys while keeping a key pressed correctly
for LWJGL (I am waiting for our new bug-tracker to become available
before I make that a case).
Johannes
PS: The sourceforge guys still havent approved our fenggui project. It
seems as it takes another day or two.
Yeah. But is there a way without polling the display whether there is
"focused" widget? The reason is that key shortcuts (like CRTL+S) do
not require a widget with focus because shortcuts are handled by the
global key listener.
Johannes
You do not need to ask the Display whether there is a focused widget.
It is fine to just call fireKeyPressed. The returned boolean can be
neglected until now... it does not consider the fact that key events
need to be intercepted by the global key listener (actually a bug...
but I am still waiting for the new tracker to become alive).
Johannes
On 9/28/06, Johannes Schaback <johannes...@gmail.com> wrote:
The well-obscured truth is that in the early days of FengGUI (when
historians called in joglui) I expected every app that uses FengGUI to
handle and forward the key and mouse events on its own. After
assembling a few examples and using FengGUI for my own stuff I started
to be annoyed of copying and pasting the same key and mouse handling
routines over and over again. So I encapsulated the routines in a
event helper class that still exists until today.
A relict of the old days can be found in
org.fenggui.example.MouseTestJOGL where I demonstrate the use of
custom mouse and key handlers. Since the helper class talks directly
to the fireXXXEvent methods, there is no way to tell for the developer
whether the mouse click hit a widget or not (because the returned
boolean vaporizes in the according method body of the helper class).
Subsequently, people who do some picking in their scenes dont get
notified whether a click hits a widget or "rays" down in the scene. So
yeah I came to the same conclusion like you.
Johannes
aside: Have you guys tried my TreeWidgetExample yet? :)
On 9/28/06, Whackjack <whac...@gmail.com> wrote: