Mercurial > sdl-ios-xcode
view src/main/qtopia/SDL_qtopia_main.cc @ 4170:092c0bc69155 SDL-1.2
Fixed bug #618
Description From Tim Angus 2008-08-30 12:23:56 (-) [reply]
As we all know SDL 1.2 doesn't handle dead keys well since one key press
potentially equals two (or more) characters. For example, on many layouts,
keying <backquote>,<space> results in <no character>,<backquote><space>. Since
the unicode member of the SDL_keysym struct only has room for one character,
only one can be returned.
On Linux, the first character is returned. On Windows however, unless the exact
number of characters generated by the keypress is 1, nothing is returned. The
following patch addresses this inconsistency.
Updated patch which includes a further fix to the handling of the numpad when
numlock is on. This further fix is courtesy Amanieu d'Antras.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 13 Apr 2009 08:42:09 +0000 |
parents | 623b453a3219 |
children | 782fd950bd46 c121d94672cb |
line wrap: on
line source
/* Include the SDL main definition header */ #include "SDL_main.h" #include <stdlib.h> #include <unistd.h> #ifdef main #undef main #endif #ifdef QWS #include <qpe/qpeapplication.h> #include <qapplication.h> #include <qpe/qpeapplication.h> #include <stdlib.h> // Workaround for OPIE to remove taskbar icon. Also fixes // some issues in Qtopia where there are left-over qcop files in /tmp/. // I'm guessing this will also clean up the taskbar in the Sharp version // of Qtopia. static inline void cleanupQCop() { QString appname(qApp->argv()[0]); int slash = appname.findRev("/"); if(slash != -1) { appname = appname.mid(slash+1); } QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'"; system(cmd.latin1()); cmd = "/tmp/qcop-msg-"+appname; unlink(cmd.latin1()); } static QPEApplication *app; #endif extern int SDL_main(int argc, char *argv[]); int main(int argc, char *argv[]) { #ifdef QWS // This initializes the Qtopia application. It needs to be done here // because it parses command line options. app = new QPEApplication(argc, argv); QWidget dummy; app->showMainWidget(&dummy); atexit(cleanupQCop); #endif // Exit here because if return is used, the application // doesn't seem to quit correctly. exit(SDL_main(argc, argv)); }