diff -r -C 2 SDL12/README.Qtopia SDL12Z/README.Qtopia *** SDL12/README.Qtopia Sat Jun 1 20:43:51 2002 --- SDL12Z/README.Qtopia Sun Nov 24 20:21:54 2002 *************** *** 47,55 **** if you end main() with 'return 0;' or so, this seems to happen. Also note that when running in landscape mode - i.e requesting a window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH and HEIGHT normally is 240 and 320 - the image is blitted so that ! the hardware buttons are on the left side of the display. This might ! not always be desirable but such is the code today. --- 47,60 ---- if you end main() with 'return 0;' or so, this seems to happen. + The application buttons are normally mapped to the F9..F13 keys. Cancel + is mapped to Esc, and Ok to Super_L. At least, this is true on the + Zaurus PDAs of the 5xxx series. + Also note that when running in landscape mode - i.e requesting a window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH and HEIGHT normally is 240 and 320 - the image is blitted so that ! the hardware buttons are on the left side of the display by default. ! You can change this behavior by setting the SDL_QT_INVERT_ROTATION ! environment variable to nonzero before running your SDL app. diff -r -C 2 SDL12/src/video/qtopia/SDL_QWin.cc SDL12Z/src/video/qtopia/SDL_QWin.cc *** SDL12/src/video/qtopia/SDL_QWin.cc Sun Sep 1 09:55:35 2002 --- SDL12Z/src/video/qtopia/SDL_QWin.cc Sun Nov 24 20:21:40 2002 *************** *** 28,33 **** --- 28,36 ---- #include "SDL_QWin.h" #include + #include #include + extern QPEApplication * myapp; + screenRotationT screenRotation = SDL_QT_NO_ROTATION; *************** *** 56,60 **** void SDL_QWin::resizeEvent(QResizeEvent *e) { ! if(size() != qApp->desktop()->size()) { // Widget is not the correct size, so do the fullscreen magic my_has_fullscreen = false; --- 59,63 ---- void SDL_QWin::resizeEvent(QResizeEvent *e) { ! if(size() != myapp->desktop()->size()) { // Widget is not the correct size, so do the fullscreen magic my_has_fullscreen = false; *************** *** 273,276 **** --- 276,280 ---- SDL_keysym keysym; int scancode = e->key(); + /* Set the keysym information */ if(scancode >= 'A' && scancode <= 'Z') { *************** *** 339,342 **** --- 343,349 ---- case Qt::Key_Super_L: scancode = SDLK_LSUPER; break; case Qt::Key_Super_R: scancode = SDLK_RSUPER; break; + /* This mapping seems pertinent - but maybe it's not? */ + case Qt::Key_Hyper_L: scancode = SDLK_LSUPER; break; + case Qt::Key_Hyper_R: scancode = SDLK_RSUPER; break; case Qt::Key_Menu: scancode = SDLK_MENU; break; case Qt::Key_Help: scancode = SDLK_HELP; break; *************** *** 383,387 **** // Make sure size is correct if(!my_has_fullscreen) { ! setFixedSize(qApp->desktop()->size()); // This call is needed because showFullScreen won't work // correctly if the widget already considers itself to be fullscreen. --- 390,394 ---- // Make sure size is correct if(!my_has_fullscreen) { ! setFixedSize(myapp->desktop()->size()); // This call is needed because showFullScreen won't work // correctly if the widget already considers itself to be fullscreen. diff -r -C 2 SDL12/src/video/qtopia/SDL_sysevents.cc SDL12Z/src/video/qtopia/SDL_sysevents.cc *** SDL12/src/video/qtopia/SDL_sysevents.cc Sun May 19 22:06:01 2002 --- SDL12Z/src/video/qtopia/SDL_sysevents.cc Sun Nov 24 20:21:40 2002 *************** *** 36,39 **** --- 36,41 ---- #include "SDL_timer.h" + extern QPEApplication * myapp; + extern "C" { #include "SDL_events_c.h" *************** *** 48,57 **** void QT_PumpEvents(_THIS) { ! if(!qApp) { return; } // printf("processing events: %p\n", qApp); //qApp->processOneEvent(); // wait for a event ! qApp->processEvents(); // and process all outstanding ones #if 0 BView *view; --- 50,59 ---- void QT_PumpEvents(_THIS) { ! if(!myapp) { return; } // printf("processing events: %p\n", qApp); //qApp->processOneEvent(); // wait for a event ! myapp->processEvents(); // and process all outstanding ones #if 0 BView *view; diff -r -C 2 SDL12/src/video/qtopia/SDL_sysvideo.cc SDL12Z/src/video/qtopia/SDL_sysvideo.cc *** SDL12/src/video/qtopia/SDL_sysvideo.cc Sun Sep 1 09:55:35 2002 --- SDL12Z/src/video/qtopia/SDL_sysvideo.cc Sun Nov 24 20:21:40 2002 *************** *** 42,45 **** --- 42,47 ---- #include "SDL_QWin.h" + QPEApplication * myapp; + extern "C" { *************** *** 226,230 **** // might as well be emulated by SDL rather than by Qtopia. ! QSize desktop_size = qApp->desktop()->size(); QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1, desktop_size.width(), desktop_size.height()); --- 228,238 ---- // might as well be emulated by SDL rather than by Qtopia. ! /* Make the menu/app keys useful to us */ ! int argc = 1; ! char *argv[] = { { "SDLApp" } }; ! myapp = new QPEApplication(argc, argv); ! myapp->grabKeyboard(); ! ! QSize desktop_size = myapp->desktop()->size(); QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1, desktop_size.width(), desktop_size.height()); *************** *** 234,238 **** /* Create the window / widget */ SDL_Win = new SDL_QWin(QSize(QT_HIDDEN_SIZE, QT_HIDDEN_SIZE)); ! ((QPEApplication*)qApp)->showMainWidget(SDL_Win); /* Fill in some window manager capabilities */ _this->info.wm_available = 0; --- 242,247 ---- /* Create the window / widget */ SDL_Win = new SDL_QWin(QSize(QT_HIDDEN_SIZE, QT_HIDDEN_SIZE)); ! ((QPEApplication*)myapp)->showMainWidget(SDL_Win); ! /* Fill in some window manager capabilities */ _this->info.wm_available = 0; *************** *** 279,283 **** QImage *qimage; ! QSize desktop_size = qApp->desktop()->size(); --- 288,292 ---- QImage *qimage; ! QSize desktop_size = myapp->desktop()->size(); *************** *** 381,384 **** --- 390,397 ---- // SDL_Win = 0; _this->screen->pixels = NULL; + + /* Don't forget to ungrab the keyboard. */ + myapp->ungrabKeyboard(); + delete myapp; }