Re: [UFO-devel] Keyboard events not firing and Texture fonts not working?
Status: Beta
Brought to you by:
schmidtjf
From: Johannes S. <sch...@us...> - 2005-07-16 13:49:33
|
On Saturday 16 July 2005 12:12, Mark Robson wrote: > Two issues I've come across: > > 1. Keyboard events are not firing on plain UWidgets. This is > demonstrated by the "events" test program in the libufo distribution. > The keyboard events don't fire at all, even after I click on the > widget. Oops, the focus manager didn't consumed mouse events. Therefore they were propagated to the parent (which was focused then). Fixed in CVS. > 2. Texture fonts don't seem to work at all either. This did work on an > older CVS version of libufo. I'm setting > > UFO_FONT=gl_texture_font > UFO_FONT_DIR=/home/mark/unpack/ufo-0.8.0/data/font > > But to no avail. I've also tried setting UFO_FONT to texture_font. Argl, every change to the source does produce bugs. There was missing an break; statement. Should be fixed in CVS. [...] > I'm trying to make a game which has a play area drawn with OpenGL plus > some menus and popup windows (UIInternalFrame) which do various other > things. > > I want to capture keyboard events on the main window, only if a popup > does not currently have the focus. How can I do this? I've tried > putting keyboard event handlers on my context's ContentPane, but this > only seems to work if there is a child control which is focused. If a focused widget is going to be hidden or removed, the root pane will be focused. Try to add your keyboard handlers to the root pane. There is also support for event listener and event grabber (using some of UContext's methods) but I consider it somehow broken .. > Is it that plain UWidgets don't take keyboard focus by default? If so, > what can I do to make it so that it can? UWidget should be focusable. > Cheers for a great library Thanks! Regards, Johannes |