src/video/nanox/SDL_nxevents.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jan 2006 13:20:10 +0000
changeset 1234 73676c1f56ee
parent 769 b8d311d90021
child 1361 19418e4422cb
permissions -rw-r--r--
For sanity's sake, removed the '&' when passing copy_row array to asm.
slouken@30
     1
/*
slouken@30
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@30
     4
    Copyright (C) 2001  Hsieh-Fu Tsai
slouken@471
     5
    Copyright (C) 2002  Greg Haerr <greg@censoft.com>
slouken@30
     6
slouken@30
     7
    This library is free software; you can redistribute it and/or
slouken@30
     8
    modify it under the terms of the GNU Library General Public
slouken@30
     9
    License as published by the Free Software Foundation; either
slouken@30
    10
    version 2 of the License, or (at your option) any later version.
slouken@30
    11
slouken@30
    12
    This library is distributed in the hope that it will be useful,
slouken@30
    13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@30
    14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@30
    15
    Library General Public License for more details.
slouken@30
    16
slouken@30
    17
    You should have received a copy of the GNU Library General Public
slouken@30
    18
    License along with this library; if not, write to the Free
slouken@30
    19
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@30
    20
slouken@30
    21
    Sam Lantinga
slouken@252
    22
    slouken@libsdl.org
slouken@30
    23
    
slouken@30
    24
    Hsieh-Fu Tsai
slouken@30
    25
    clare@setabox.com
slouken@30
    26
*/
slouken@30
    27
slouken@30
    28
#include "SDL_keysym.h"
slouken@30
    29
#include "SDL_events_c.h"
slouken@30
    30
slouken@30
    31
#include "SDL_nxevents_c.h"
slouken@30
    32
#include "SDL_nximage_c.h"
slouken@30
    33
slouken@30
    34
// The translation tables from a nanox keysym to a SDL keysym
slouken@30
    35
static SDLKey NX_NONASCII_keymap [MWKEY_LAST + 1] ;
slouken@30
    36
slouken@30
    37
void NX_InitOSKeymap (_THIS)
slouken@30
    38
{
slouken@30
    39
    int i ;
slouken@30
    40
slouken@30
    41
    Dprintf ("enter NX_InitOSKeymap\n") ;
slouken@30
    42
slouken@30
    43
    // Map the nanox scancodes to SDL keysyms
slouken@30
    44
    for (i = 0; i < SDL_TABLESIZE (NX_NONASCII_keymap); ++ i)
slouken@30
    45
        NX_NONASCII_keymap [i] = SDLK_UNKNOWN ;
slouken@30
    46
slouken@30
    47
    NX_NONASCII_keymap [MWKEY_LEFT        & 0xFF] = SDLK_LEFT ;
slouken@30
    48
    NX_NONASCII_keymap [MWKEY_RIGHT       & 0xFF] = SDLK_RIGHT ;
slouken@30
    49
    NX_NONASCII_keymap [MWKEY_UP          & 0xFF] = SDLK_UP ;
slouken@30
    50
    NX_NONASCII_keymap [MWKEY_DOWN        & 0xFF] = SDLK_DOWN ;
slouken@30
    51
    NX_NONASCII_keymap [MWKEY_INSERT      & 0xFF] = SDLK_INSERT ;
slouken@30
    52
    NX_NONASCII_keymap [MWKEY_DELETE      & 0xFF] = SDLK_DELETE ;
slouken@30
    53
    NX_NONASCII_keymap [MWKEY_HOME        & 0xFF] = SDLK_HOME ;
slouken@30
    54
    NX_NONASCII_keymap [MWKEY_END         & 0xFF] = SDLK_END ;
slouken@30
    55
    NX_NONASCII_keymap [MWKEY_PAGEUP      & 0xFF] = SDLK_PAGEUP ;
slouken@30
    56
    NX_NONASCII_keymap [MWKEY_PAGEDOWN    & 0xFF] = SDLK_PAGEDOWN ;
slouken@30
    57
slouken@30
    58
    NX_NONASCII_keymap [MWKEY_KP0         & 0xFF] = SDLK_KP0 ;
slouken@30
    59
    NX_NONASCII_keymap [MWKEY_KP1         & 0xFF] = SDLK_KP1 ;
slouken@30
    60
    NX_NONASCII_keymap [MWKEY_KP2         & 0xFF] = SDLK_KP2 ;
slouken@30
    61
    NX_NONASCII_keymap [MWKEY_KP3         & 0xFF] = SDLK_KP3 ;
slouken@30
    62
    NX_NONASCII_keymap [MWKEY_KP4         & 0xFF] = SDLK_KP4 ;
slouken@30
    63
    NX_NONASCII_keymap [MWKEY_KP5         & 0xFF] = SDLK_KP5 ;
slouken@30
    64
    NX_NONASCII_keymap [MWKEY_KP6         & 0xFF] = SDLK_KP6 ;
slouken@30
    65
    NX_NONASCII_keymap [MWKEY_KP7         & 0xFF] = SDLK_KP7 ;
slouken@30
    66
    NX_NONASCII_keymap [MWKEY_KP8         & 0xFF] = SDLK_KP8 ;
slouken@30
    67
    NX_NONASCII_keymap [MWKEY_KP9         & 0xFF] = SDLK_KP9 ;
slouken@30
    68
    NX_NONASCII_keymap [MWKEY_KP_PERIOD   & 0xFF] = SDLK_KP_PERIOD ;
slouken@30
    69
    NX_NONASCII_keymap [MWKEY_KP_DIVIDE   & 0xFF] = SDLK_KP_DIVIDE ;
slouken@30
    70
    NX_NONASCII_keymap [MWKEY_KP_MULTIPLY & 0xFF] = SDLK_KP_MULTIPLY ;
slouken@30
    71
    NX_NONASCII_keymap [MWKEY_KP_MINUS    & 0xFF] = SDLK_KP_MINUS ;
slouken@30
    72
    NX_NONASCII_keymap [MWKEY_KP_PLUS     & 0xFF] = SDLK_KP_PLUS ;
slouken@30
    73
    NX_NONASCII_keymap [MWKEY_KP_ENTER    & 0xFF] = SDLK_KP_ENTER ;
slouken@30
    74
    NX_NONASCII_keymap [MWKEY_KP_EQUALS   & 0xFF] = SDLK_KP_EQUALS ;
slouken@30
    75
slouken@30
    76
    NX_NONASCII_keymap [MWKEY_F1          & 0xFF] = SDLK_F1 ;
slouken@30
    77
    NX_NONASCII_keymap [MWKEY_F2          & 0xFF] = SDLK_F2 ;
slouken@30
    78
    NX_NONASCII_keymap [MWKEY_F3          & 0xFF] = SDLK_F3 ;
slouken@30
    79
    NX_NONASCII_keymap [MWKEY_F4          & 0xFF] = SDLK_F4 ;
slouken@30
    80
    NX_NONASCII_keymap [MWKEY_F5          & 0xFF] = SDLK_F5 ;
slouken@30
    81
    NX_NONASCII_keymap [MWKEY_F6          & 0xFF] = SDLK_F6 ;
slouken@30
    82
    NX_NONASCII_keymap [MWKEY_F7          & 0xFF] = SDLK_F7 ;
slouken@30
    83
    NX_NONASCII_keymap [MWKEY_F8          & 0xFF] = SDLK_F8 ;
slouken@30
    84
    NX_NONASCII_keymap [MWKEY_F9          & 0xFF] = SDLK_F9 ;
slouken@30
    85
    NX_NONASCII_keymap [MWKEY_F10         & 0xFF] = SDLK_F10 ;
slouken@30
    86
    NX_NONASCII_keymap [MWKEY_F11         & 0xFF] = SDLK_F11 ;
slouken@30
    87
    NX_NONASCII_keymap [MWKEY_F12         & 0xFF] = SDLK_F12 ;
slouken@30
    88
slouken@30
    89
    NX_NONASCII_keymap [MWKEY_NUMLOCK     & 0xFF] = SDLK_NUMLOCK ;
slouken@30
    90
    NX_NONASCII_keymap [MWKEY_CAPSLOCK    & 0xFF] = SDLK_CAPSLOCK ;
slouken@30
    91
    NX_NONASCII_keymap [MWKEY_SCROLLOCK   & 0xFF] = SDLK_SCROLLOCK ;
slouken@30
    92
    NX_NONASCII_keymap [MWKEY_LSHIFT      & 0xFF] = SDLK_LSHIFT ;
slouken@30
    93
    NX_NONASCII_keymap [MWKEY_RSHIFT      & 0xFF] = SDLK_RSHIFT ;
slouken@30
    94
    NX_NONASCII_keymap [MWKEY_LCTRL       & 0xFF] = SDLK_LCTRL ;
slouken@30
    95
    NX_NONASCII_keymap [MWKEY_RCTRL       & 0xFF] = SDLK_RCTRL ;
slouken@30
    96
    NX_NONASCII_keymap [MWKEY_LALT        & 0xFF] = SDLK_LALT ;
slouken@30
    97
    NX_NONASCII_keymap [MWKEY_RALT        & 0xFF] = SDLK_RALT ;
slouken@30
    98
    NX_NONASCII_keymap [MWKEY_LMETA       & 0xFF] = SDLK_LMETA ;
slouken@30
    99
    NX_NONASCII_keymap [MWKEY_RMETA       & 0xFF] = SDLK_RMETA ;
slouken@30
   100
    NX_NONASCII_keymap [MWKEY_ALTGR       & 0xFF] = SDLK_MODE ;
slouken@30
   101
slouken@30
   102
    NX_NONASCII_keymap [MWKEY_PRINT       & 0xFF] = SDLK_PRINT ;
slouken@30
   103
    NX_NONASCII_keymap [MWKEY_SYSREQ      & 0xFF] = SDLK_SYSREQ ;
slouken@30
   104
    NX_NONASCII_keymap [MWKEY_PAUSE       & 0xFF] = SDLK_PAUSE ;
slouken@30
   105
    NX_NONASCII_keymap [MWKEY_BREAK       & 0xFF] = SDLK_BREAK ;
slouken@30
   106
    NX_NONASCII_keymap [MWKEY_MENU        & 0xFF] = SDLK_MENU ;
slouken@30
   107
slouken@30
   108
    Dprintf ("leave NX_InitOSKeymap\n") ;
slouken@30
   109
}
slouken@30
   110
slouken@30
   111
SDL_keysym * NX_TranslateKey (GR_EVENT_KEYSTROKE * keystroke, SDL_keysym * keysym)
slouken@30
   112
{
slouken@30
   113
    GR_KEY ch = keystroke -> ch ;
slouken@30
   114
slouken@30
   115
    Dprintf ("enter NX_TranslateKey\n") ;
slouken@30
   116
slouken@30
   117
    keysym -> scancode = keystroke -> scancode ;
slouken@30
   118
    keysym -> sym = SDLK_UNKNOWN ;
slouken@30
   119
slouken@30
   120
    if (ch & MWKEY_NONASCII_MASK) {
slouken@30
   121
        keysym -> sym = NX_NONASCII_keymap [ch & 0xFF] ;
slouken@30
   122
    } else {
slouken@30
   123
        keysym -> sym = ch & 0x7F ;
slouken@30
   124
    }
slouken@30
   125
slouken@30
   126
    keysym -> mod = KMOD_NONE ;
slouken@30
   127
    
slouken@30
   128
#if 1   //   Retrieve more mode information
slouken@30
   129
    {
slouken@30
   130
        GR_KEYMOD   mod = keystroke -> modifiers ;
slouken@30
   131
slouken@30
   132
        if (mod & MWKMOD_LSHIFT)
slouken@30
   133
            keysym -> mod |= KMOD_LSHIFT ;
slouken@30
   134
        if (mod & MWKMOD_RSHIFT)
slouken@30
   135
            keysym -> mod |= KMOD_RSHIFT ;
slouken@30
   136
        if (mod & MWKMOD_LCTRL)
slouken@30
   137
            keysym -> mod |= KMOD_LCTRL ;
slouken@30
   138
        if (mod & MWKMOD_RCTRL)
slouken@30
   139
            keysym -> mod |= KMOD_RCTRL ;
slouken@30
   140
        if (mod & MWKMOD_LALT)
slouken@30
   141
            keysym -> mod |= KMOD_LALT ;
slouken@30
   142
        if (mod & MWKMOD_RALT)
slouken@30
   143
            keysym -> mod |= KMOD_RALT ;
slouken@30
   144
        if (mod & MWKMOD_LMETA)
slouken@30
   145
            keysym -> mod |= KMOD_LMETA ;
slouken@30
   146
        if (mod & MWKMOD_RMETA)
slouken@30
   147
            keysym -> mod |= KMOD_RMETA ;
slouken@30
   148
        if (mod & MWKMOD_NUM)
slouken@30
   149
            keysym -> mod |= KMOD_NUM ;
slouken@30
   150
        if (mod & MWKMOD_CAPS)
slouken@30
   151
            keysym -> mod |= KMOD_CAPS ;
slouken@30
   152
        if (mod & MWKMOD_ALTGR)
slouken@30
   153
            keysym -> mod |= KMOD_MODE ;
slouken@30
   154
    }
slouken@30
   155
#endif
slouken@30
   156
slouken@30
   157
    keysym -> unicode = ch ;
slouken@30
   158
slouken@30
   159
    Dprintf ("leave NX_TranslateKey\n") ;
slouken@30
   160
    return keysym ;
slouken@30
   161
}
slouken@30
   162
slouken@30
   163
static int check_boundary (_THIS, int x, int y)
slouken@30
   164
{
slouken@30
   165
    if (x < OffsetX || y < OffsetY || x > OffsetX + this -> screen -> w ||
slouken@30
   166
        y > OffsetY + this -> screen -> h)
slouken@30
   167
        return 0 ;
slouken@30
   168
            
slouken@30
   169
    return 1 ;
slouken@30
   170
}
slouken@30
   171
slouken@30
   172
void NX_PumpEvents (_THIS)
slouken@30
   173
{
slouken@30
   174
    GR_EVENT         event ;
slouken@30
   175
    static GR_BUTTON last_button_down = 0 ;
slouken@30
   176
slouken@30
   177
    GrCheckNextEvent (& event) ;
slouken@30
   178
    while (event.type != GR_EVENT_TYPE_NONE) {
slouken@30
   179
slouken@30
   180
        // dispatch event
slouken@30
   181
        switch (event.type) {
slouken@30
   182
            case GR_EVENT_TYPE_MOUSE_ENTER :
slouken@30
   183
            {
slouken@30
   184
                Dprintf ("mouse enter\n") ;
slouken@30
   185
                SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS) ;
slouken@30
   186
                break ;
slouken@30
   187
            }
slouken@30
   188
slouken@30
   189
            case GR_EVENT_TYPE_MOUSE_EXIT :
slouken@30
   190
            {
slouken@30
   191
                Dprintf ("mouse exit\n") ;
slouken@30
   192
                SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS) ;
slouken@30
   193
                break ;
slouken@30
   194
            }
slouken@30
   195
slouken@30
   196
            case GR_EVENT_TYPE_FOCUS_IN :
slouken@30
   197
            {
slouken@30
   198
                Dprintf ("focus in\n") ;
slouken@30
   199
                SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS) ;
slouken@30
   200
                break ;
slouken@30
   201
            }
slouken@30
   202
slouken@30
   203
            case GR_EVENT_TYPE_FOCUS_OUT :
slouken@30
   204
            {
slouken@30
   205
                Dprintf ("focus out\n") ;
slouken@30
   206
                SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS) ;
slouken@30
   207
                break ;
slouken@30
   208
            }
slouken@30
   209
slouken@30
   210
            case GR_EVENT_TYPE_MOUSE_MOTION :
slouken@30
   211
            {               
slouken@30
   212
                Dprintf ("mouse motion\n") ;
slouken@30
   213
slouken@30
   214
                if (SDL_VideoSurface) {
slouken@30
   215
                    if (currently_fullscreen) {
slouken@30
   216
                        if (check_boundary (this, event.button.x, event.button.y)) {
slouken@30
   217
                            SDL_PrivateMouseMotion (0, 0, event.button.x - OffsetX, 
slouken@30
   218
                                event.button.y - OffsetY) ;
slouken@30
   219
                        }
slouken@30
   220
                    } else {
slouken@30
   221
                        SDL_PrivateMouseMotion (0, 0, event.button.x, event.button.y) ;
slouken@30
   222
                    }
slouken@30
   223
                }
slouken@30
   224
                break ;
slouken@30
   225
            }
slouken@30
   226
slouken@30
   227
            case GR_EVENT_TYPE_BUTTON_DOWN :
slouken@30
   228
            {
slouken@30
   229
                int button = event.button.buttons ;
slouken@30
   230
                
slouken@30
   231
                Dprintf ("button down\n") ;
slouken@30
   232
slouken@30
   233
                switch (button) {
slouken@30
   234
                    case MWBUTTON_L :
slouken@30
   235
                        button = 1 ;
slouken@30
   236
                        break ;
slouken@30
   237
                    case MWBUTTON_M :
slouken@30
   238
                        button = 2 ;
slouken@30
   239
                        break ;
slouken@30
   240
                    case MWBUTTON_R :
slouken@30
   241
                        button = 3 ;
slouken@30
   242
                        break ;
slouken@30
   243
                    default :
slouken@30
   244
                        button = 0 ;
slouken@30
   245
                }
slouken@30
   246
                last_button_down = button ;
slouken@30
   247
                
slouken@30
   248
                if (currently_fullscreen) {
slouken@30
   249
                    if (check_boundary (this, event.button.x, event.button.y)) {
slouken@30
   250
                        SDL_PrivateMouseButton (SDL_PRESSED, button, 
slouken@30
   251
                            event.button.x - OffsetX, event.button.y - OffsetY) ;
slouken@30
   252
                    }
slouken@30
   253
                } else {
slouken@30
   254
                    SDL_PrivateMouseButton (SDL_PRESSED, button, 
slouken@30
   255
                        event.button.x, event.button.y) ;
slouken@30
   256
                }
slouken@30
   257
                break ;
slouken@30
   258
            }
slouken@30
   259
slouken@30
   260
            // do not konw which button is released
slouken@30
   261
            case GR_EVENT_TYPE_BUTTON_UP :
slouken@30
   262
            {   
slouken@30
   263
                Dprintf ("button up\n") ;
slouken@30
   264
slouken@30
   265
                if (currently_fullscreen) {
slouken@30
   266
                    if (check_boundary (this, event.button.x, event.button.y)) {
slouken@30
   267
                        SDL_PrivateMouseButton (SDL_RELEASED, last_button_down, 
slouken@30
   268
                            event.button.x - OffsetX, event.button.y - OffsetY) ;
slouken@30
   269
                    }
slouken@30
   270
                } else {
slouken@30
   271
                    SDL_PrivateMouseButton (SDL_RELEASED, last_button_down, 
slouken@30
   272
                        event.button.x, event.button.y) ;
slouken@30
   273
                }
slouken@30
   274
                last_button_down = 0 ;
slouken@30
   275
                break ;
slouken@30
   276
            }
slouken@30
   277
slouken@30
   278
            case GR_EVENT_TYPE_KEY_DOWN :
slouken@30
   279
            {
slouken@30
   280
                SDL_keysym keysym ;
slouken@30
   281
slouken@30
   282
                Dprintf ("key down\n") ;
slouken@30
   283
                SDL_PrivateKeyboard (SDL_PRESSED,
slouken@30
   284
                    NX_TranslateKey (& event.keystroke, & keysym)) ;
slouken@30
   285
                break ;
slouken@30
   286
            }
slouken@30
   287
slouken@30
   288
            case GR_EVENT_TYPE_KEY_UP :
slouken@30
   289
            {
slouken@30
   290
                SDL_keysym keysym ;
slouken@30
   291
slouken@30
   292
                Dprintf ("key up\n") ;
slouken@30
   293
                SDL_PrivateKeyboard (SDL_RELEASED,
slouken@30
   294
                    NX_TranslateKey (& event.keystroke, & keysym)) ;
slouken@30
   295
                break ;
slouken@30
   296
            }
slouken@30
   297
slouken@30
   298
            case GR_EVENT_TYPE_CLOSE_REQ :
slouken@30
   299
            {
slouken@30
   300
                Dprintf ("close require\n") ;
slouken@30
   301
                SDL_PrivateQuit () ;
slouken@30
   302
                break ;
slouken@30
   303
            }
slouken@30
   304
slouken@30
   305
            case GR_EVENT_TYPE_EXPOSURE :
slouken@30
   306
            {
slouken@30
   307
                Dprintf ("event_type_exposure\n") ;
slouken@30
   308
                if (SDL_VideoSurface) {
slouken@30
   309
                    NX_RefreshDisplay (this) ;//, & event.exposure) ;
slouken@30
   310
                }
slouken@30
   311
                break ;
slouken@30
   312
            }
slouken@30
   313
slouken@30
   314
            case GR_EVENT_TYPE_UPDATE :
slouken@30
   315
            {
slouken@30
   316
                switch (event.update.utype) {
slouken@30
   317
                    case GR_UPDATE_MAP :
slouken@30
   318
                    {
slouken@30
   319
                        Dprintf ("GR_UPDATE_MAP\n") ;
slouken@30
   320
                        // If we're not active, make ourselves active
slouken@30
   321
                        if (!(SDL_GetAppState () & SDL_APPACTIVE)) {
slouken@30
   322
                            // Send an internal activate event
slouken@30
   323
                            SDL_PrivateAppActive (1, SDL_APPACTIVE) ;
slouken@30
   324
                        }
slouken@30
   325
                        if (SDL_VideoSurface) {
slouken@30
   326
                            NX_RefreshDisplay (this) ;
slouken@30
   327
                        }
slouken@30
   328
                        break ;
slouken@30
   329
                    }
slouken@30
   330
                    
slouken@30
   331
                    case GR_UPDATE_UNMAP :
slouken@30
   332
                    case GR_UPDATE_UNMAPTEMP :
slouken@30
   333
                    {
slouken@30
   334
                        Dprintf ("GR_UPDATE_UNMAP or GR_UPDATE_UNMAPTEMP\n") ;
slouken@30
   335
                        // If we're active, make ourselves inactive
slouken@30
   336
                        if (SDL_GetAppState () & SDL_APPACTIVE) {
slouken@30
   337
                            // Send an internal deactivate event
slouken@30
   338
                            SDL_PrivateAppActive (0, SDL_APPACTIVE | SDL_APPINPUTFOCUS) ;
slouken@30
   339
                        }
slouken@30
   340
                        break ; 
slouken@30
   341
                    }
slouken@30
   342
                    
slouken@30
   343
                    case GR_UPDATE_SIZE :
slouken@30
   344
                    {
slouken@30
   345
                        Dprintf ("GR_UPDATE_SIZE\n") ;
slouken@30
   346
                        SDL_PrivateResize (event.update.width, event.update.height) ;
slouken@30
   347
                        break ; 
slouken@30
   348
                    }
slouken@471
   349
slouken@471
   350
                    case GR_UPDATE_MOVE :
slouken@471
   351
		    case GR_UPDATE_REPARENT :
slouken@471
   352
                    {
slouken@471
   353
                        Dprintf ("GR_UPDATE_MOVE or GR_UPDATE_REPARENT\n") ;
slouken@471
   354
#ifdef ENABLE_NANOX_DIRECT_FB
slouken@471
   355
			if (Clientfb) {
slouken@471
   356
			    /* Get current window position and fb pointer*/
slouken@471
   357
			    if (currently_fullscreen) 
slouken@471
   358
				GrGetWindowFBInfo(FSwindow, &fbinfo);
slouken@471
   359
			    else
slouken@471
   360
				GrGetWindowFBInfo(SDL_Window, &fbinfo);
slouken@471
   361
			}
slouken@471
   362
#endif
slouken@471
   363
                        break ; 
slouken@471
   364
                    }
slouken@30
   365
                    
slouken@30
   366
                    default :
slouken@30
   367
                        Dprintf ("unknown GR_EVENT_TYPE_UPDATE\n") ;
slouken@30
   368
                        break ; 
slouken@30
   369
                }
slouken@30
   370
                break ; 
slouken@30
   371
            }
slouken@30
   372
                
slouken@30
   373
            default :
slouken@30
   374
            {
slouken@30
   375
                Dprintf ("pump event default\n") ;
slouken@30
   376
            }
slouken@30
   377
        }
slouken@30
   378
slouken@30
   379
        GrCheckNextEvent (& event) ;
slouken@30
   380
    }
slouken@30
   381
}