PDA

View Full Version : SDL Keyboard focus


jolouis
08-07-2009, 11:48 AM
I'm working on porting the Flipclock application from it's current Python base over to a direct C/SDL implementation, but have been running into some odd issues. I've managed to get the basic interface up and displayed, using SDL events to check for keypresses/etc which is all good and dandy, but as soon as I launch the app in non-fullscreen mode (or toggle to non-fullscreen by calling SDL_WM_ToggleFullScreen) I loose any ability to interact with the hardware keys on the tablet; that is, press the fullscreen button on the tablet and I can change to "window mode", but after that no other keys even register events anymore. Any ideas? I can post up a compiled version of what I've got if that would help...

The other question that I have related to this is.. is there some kind of event or way of monitoring when the application gets restored from being minimized, or at least gets focus again? I have the display redraw only set to happen once per minute to save battery/CPU power (it's a clock afterall), but if I press the home key to bring up the task manager, when I close the task manager the area that was behind it needs to be redrawn; similiarly if I minimize the app it's all good, but when I restore it from being minimized nothing shows up until the next redraw time...

Any help/ideas/etc greatly appreciated!!

jolouis
08-07-2009, 12:34 PM
Never mind, feel like a goof... I had a runaway event polling loop that was keeping the app from responding after it handled the first event... fixing that seems to have solved all problems...

ciroip
08-08-2009, 03:39 PM
great: I was thinking to replicate (enhance) the flipclock's routines for the inteface/sounds/time managments in c and SDL after the 1st experimental porting.
If you already are on the project Ill focus on a now abandoned media player project and follow your flipclock progress to steal some dev ideas :)