src/video/ataricommon/SDL_gemdosevents.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/video/ataricommon/SDL_gemdosevents.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_gemdosevents.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -68,21 +68,21 @@
     1.4  /* The translation tables from a console scancode to a SDL keysym */
     1.5  static SDLKey keymap[ATARIBIOS_MAXKEYS];
     1.6  
     1.7 -static SDL_keysym *TranslateKey (int scancode, int asciicode,
     1.8 -                                 SDL_keysym * keysym, SDL_bool pressed);
     1.9 -static void UpdateSpecialKeys (int special_keys_state);
    1.10 +static SDL_keysym *TranslateKey(int scancode, int asciicode,
    1.11 +                                SDL_keysym * keysym, SDL_bool pressed);
    1.12 +static void UpdateSpecialKeys(int special_keys_state);
    1.13  
    1.14  void
    1.15 -AtariGemdos_InitOSKeymap (_THIS)
    1.16 +AtariGemdos_InitOSKeymap(_THIS)
    1.17  {
    1.18      int i, vectors_mask;
    1.19      unsigned long dummy;
    1.20  
    1.21 -    SDL_memset (gemdos_currentkeyboard, 0, sizeof (gemdos_currentkeyboard));
    1.22 -    SDL_memset (gemdos_previouskeyboard, 0, sizeof (gemdos_previouskeyboard));
    1.23 +    SDL_memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard));
    1.24 +    SDL_memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard));
    1.25  
    1.26      /* Initialize keymap */
    1.27 -    for (i = 0; i < sizeof (keymap); i++)
    1.28 +    for (i = 0; i < sizeof(keymap); i++)
    1.29          keymap[i] = SDLK_UNKNOWN;
    1.30  
    1.31      /* Functions keys */
    1.32 @@ -111,32 +111,32 @@
    1.33      keymap[SCANCODE_LEFTALT] = SDLK_LALT;
    1.34      keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
    1.35  
    1.36 -    use_dev_mouse = (SDL_AtariDevMouse_Open () != 0) ? SDL_TRUE : SDL_FALSE;
    1.37 +    use_dev_mouse = (SDL_AtariDevMouse_Open() != 0) ? SDL_TRUE : SDL_FALSE;
    1.38  
    1.39      vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS;  /* XBIOS joystick events */
    1.40      if (!use_dev_mouse) {
    1.41          vectors_mask |= ATARI_XBIOS_MOUSEEVENTS;        /* XBIOS mouse events */
    1.42      }
    1.43 -    if (Getcookie (C_MiNT, &dummy) == C_FOUND) {
    1.44 +    if (Getcookie(C_MiNT, &dummy) == C_FOUND) {
    1.45          vectors_mask = 0;
    1.46      }
    1.47 -    SDL_AtariXbios_InstallVectors (vectors_mask);
    1.48 +    SDL_AtariXbios_InstallVectors(vectors_mask);
    1.49  }
    1.50  
    1.51  void
    1.52 -AtariGemdos_PumpEvents (_THIS)
    1.53 +AtariGemdos_PumpEvents(_THIS)
    1.54  {
    1.55      int i;
    1.56      SDL_keysym keysym;
    1.57  
    1.58      /* Update pressed keys */
    1.59 -    SDL_memset (gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
    1.60 +    SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
    1.61  
    1.62 -    while (Cconis () != DEV_BUSY) {
    1.63 +    while (Cconis() != DEV_BUSY) {
    1.64          unsigned long key_pressed;
    1.65          unsigned char scancode, asciicode;
    1.66  
    1.67 -        key_pressed = Cnecin ();
    1.68 +        key_pressed = Cnecin();
    1.69  
    1.70          asciicode = key_pressed;
    1.71          scancode = key_pressed >> 16;
    1.72 @@ -146,36 +146,36 @@
    1.73      }
    1.74  
    1.75      /* Read special keys */
    1.76 -    UpdateSpecialKeys (Kbshift (-1));
    1.77 +    UpdateSpecialKeys(Kbshift(-1));
    1.78  
    1.79      /* Now generate events */
    1.80      for (i = 0; i < ATARIBIOS_MAXKEYS; i++) {
    1.81          /* Key pressed ? */
    1.82          if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i])
    1.83 -            SDL_PrivateKeyboard (SDL_PRESSED,
    1.84 -                                 TranslateKey (i, gemdos_currentascii[i],
    1.85 -                                               &keysym, SDL_TRUE));
    1.86 +            SDL_PrivateKeyboard(SDL_PRESSED,
    1.87 +                                TranslateKey(i, gemdos_currentascii[i],
    1.88 +                                             &keysym, SDL_TRUE));
    1.89  
    1.90          /* Key unpressed ? */
    1.91          if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
    1.92 -            SDL_PrivateKeyboard (SDL_RELEASED,
    1.93 -                                 TranslateKey (i, gemdos_currentascii[i],
    1.94 -                                               &keysym, SDL_FALSE));
    1.95 +            SDL_PrivateKeyboard(SDL_RELEASED,
    1.96 +                                TranslateKey(i, gemdos_currentascii[i],
    1.97 +                                             &keysym, SDL_FALSE));
    1.98      }
    1.99  
   1.100      if (use_dev_mouse) {
   1.101 -        SDL_AtariDevMouse_PostMouseEvents (this, SDL_TRUE);
   1.102 +        SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
   1.103      } else {
   1.104 -        SDL_AtariXbios_PostMouseEvents (this, SDL_TRUE);
   1.105 +        SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
   1.106      }
   1.107  
   1.108      /* Will be previous table */
   1.109 -    SDL_memcpy (gemdos_previouskeyboard, gemdos_currentkeyboard,
   1.110 -                ATARIBIOS_MAXKEYS);
   1.111 +    SDL_memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard,
   1.112 +               ATARIBIOS_MAXKEYS);
   1.113  }
   1.114  
   1.115  static void
   1.116 -UpdateSpecialKeys (int special_keys_state)
   1.117 +UpdateSpecialKeys(int special_keys_state)
   1.118  {
   1.119  #define UPDATE_SPECIAL_KEYS(numbit,scancode) \
   1.120  	{	\
   1.121 @@ -185,16 +185,16 @@
   1.122  		}	\
   1.123  	}
   1.124  
   1.125 -    UPDATE_SPECIAL_KEYS (K_RSHIFT, SCANCODE_RIGHTSHIFT);
   1.126 -    UPDATE_SPECIAL_KEYS (K_LSHIFT, SCANCODE_LEFTSHIFT);
   1.127 -    UPDATE_SPECIAL_KEYS (K_CTRL, SCANCODE_LEFTCONTROL);
   1.128 -    UPDATE_SPECIAL_KEYS (K_ALT, SCANCODE_LEFTALT);
   1.129 -    UPDATE_SPECIAL_KEYS (K_CAPSLOCK, SCANCODE_CAPSLOCK);
   1.130 +    UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT);
   1.131 +    UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT);
   1.132 +    UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL);
   1.133 +    UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT);
   1.134 +    UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
   1.135  }
   1.136  
   1.137  static SDL_keysym *
   1.138 -TranslateKey (int scancode, int asciicode, SDL_keysym * keysym,
   1.139 -              SDL_bool pressed)
   1.140 +TranslateKey(int scancode, int asciicode, SDL_keysym * keysym,
   1.141 +             SDL_bool pressed)
   1.142  {
   1.143      /* Set the keysym information */
   1.144      keysym->scancode = scancode;
   1.145 @@ -214,11 +214,11 @@
   1.146  }
   1.147  
   1.148  void
   1.149 -AtariGemdos_ShutdownEvents (void)
   1.150 +AtariGemdos_ShutdownEvents(void)
   1.151  {
   1.152 -    SDL_AtariXbios_RestoreVectors ();
   1.153 +    SDL_AtariXbios_RestoreVectors();
   1.154      if (use_dev_mouse) {
   1.155 -        SDL_AtariDevMouse_Close ();
   1.156 +        SDL_AtariDevMouse_Close();
   1.157      }
   1.158  }
   1.159