~ubuntu-branches/ubuntu/natty/libsdl1.2/natty

« back to all changes in this revision

Viewing changes to src/video/windib/SDL_dibevents.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 20:29:43 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071205202943-ryogi07hodn5cdif
Tags: 1.2.12-1ubuntu1
* Merge with Debian; remaining changes:
  - Remove svgalib support.
  - Prefer libgl1-mesa-dev build-dependency over xlibmesa-gl-dev.
  - Build for lpia as for i386.
* Link using -Wl,-Bsymbolic-functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
 
226
226
#if defined(SC_SCREENSAVE) && defined(SC_MONITORPOWER)
227
227
                case WM_SYSCOMMAND: {
228
 
                        if ((wParam&0xFFF0)==SC_SCREENSAVE ||
229
 
                                (wParam&0xFFF0)==SC_MONITORPOWER)
 
228
                        const DWORD val = (DWORD) (wParam & 0xFFF0);
 
229
                        if ((val == SC_SCREENSAVE) || (val == SC_MONITORPOWER)) {
 
230
                                if (!this->hidden->allow_screensaver) {
 
231
                                        /* Note that this doesn't stop anything on Vista
 
232
                                           if the screensaver has a password. */
230
233
                                        return(0);
 
234
                                }
 
235
                        }
231
236
                }
232
237
                /* Fall through to default processing */
233
238
#endif /* SC_SCREENSAVE && SC_MONITORPOWER */
273
278
void DIB_InitOSKeymap(_THIS)
274
279
{
275
280
        int     i;
276
 
        char    current_layout[256];
 
281
#ifndef _WIN32_WCE
 
282
        char    current_layout[KL_NAMELENGTH];
277
283
 
278
284
        GetKeyboardLayoutName(current_layout);
279
285
        //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
280
286
 
281
287
        hLayoutUS = LoadKeyboardLayout("00000409", KLF_NOTELLSHELL);
 
288
 
282
289
        if (!hLayoutUS) {
283
290
                //printf("Failed to load US keyboard layout. Using current.\n");
284
291
                hLayoutUS = GetKeyboardLayout(0);
285
292
        }
286
293
        LoadKeyboardLayout(current_layout, KLF_ACTIVATE);
287
 
 
 
294
#else
 
295
#if _WIN32_WCE >=420
 
296
        TCHAR   current_layout[KL_NAMELENGTH];
 
297
 
 
298
        GetKeyboardLayoutName(current_layout);
 
299
        //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
 
300
 
 
301
        hLayoutUS = LoadKeyboardLayout(L"00000409", 0);
 
302
 
 
303
        if (!hLayoutUS) {
 
304
                //printf("Failed to load US keyboard layout. Using current.\n");
 
305
                hLayoutUS = GetKeyboardLayout(0);
 
306
        }
 
307
        LoadKeyboardLayout(current_layout, 0);
 
308
#endif // _WIN32_WCE >=420
 
309
#endif
288
310
        /* Map the VK keysyms */
289
311
        for ( i=0; i<SDL_arraysize(VK_keymap); ++i )
290
312
                VK_keymap[i] = SDLK_UNKNOWN;
414
436
 
415
437
static int SDL_MapVirtualKey(int scancode, int vkey)
416
438
{
 
439
#ifndef _WIN32_WCE
417
440
        int     mvke  = MapVirtualKeyEx(scancode & 0xFF, 1, hLayoutUS);
 
441
#else
 
442
        int     mvke  = MapVirtualKey(scancode & 0xFF, 1);
 
443
#endif
418
444
 
419
445
        switch(vkey) {
420
446
                /* These are always correct */