Mercurial > sdl-ios-xcode
diff src/video/ataricommon/SDL_gemdosevents.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
line wrap: on
line diff
--- a/src/video/ataricommon/SDL_gemdosevents.c Mon May 29 03:53:21 2006 +0000 +++ b/src/video/ataricommon/SDL_gemdosevents.c Mon May 29 04:04:35 2006 +0000 @@ -68,21 +68,21 @@ /* The translation tables from a console scancode to a SDL keysym */ static SDLKey keymap[ATARIBIOS_MAXKEYS]; -static SDL_keysym *TranslateKey (int scancode, int asciicode, - SDL_keysym * keysym, SDL_bool pressed); -static void UpdateSpecialKeys (int special_keys_state); +static SDL_keysym *TranslateKey(int scancode, int asciicode, + SDL_keysym * keysym, SDL_bool pressed); +static void UpdateSpecialKeys(int special_keys_state); void -AtariGemdos_InitOSKeymap (_THIS) +AtariGemdos_InitOSKeymap(_THIS) { int i, vectors_mask; unsigned long dummy; - SDL_memset (gemdos_currentkeyboard, 0, sizeof (gemdos_currentkeyboard)); - SDL_memset (gemdos_previouskeyboard, 0, sizeof (gemdos_previouskeyboard)); + SDL_memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard)); + SDL_memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard)); /* Initialize keymap */ - for (i = 0; i < sizeof (keymap); i++) + for (i = 0; i < sizeof(keymap); i++) keymap[i] = SDLK_UNKNOWN; /* Functions keys */ @@ -111,32 +111,32 @@ keymap[SCANCODE_LEFTALT] = SDLK_LALT; keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK; - use_dev_mouse = (SDL_AtariDevMouse_Open () != 0) ? SDL_TRUE : SDL_FALSE; + use_dev_mouse = (SDL_AtariDevMouse_Open() != 0) ? SDL_TRUE : SDL_FALSE; vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */ if (!use_dev_mouse) { vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */ } - if (Getcookie (C_MiNT, &dummy) == C_FOUND) { + if (Getcookie(C_MiNT, &dummy) == C_FOUND) { vectors_mask = 0; } - SDL_AtariXbios_InstallVectors (vectors_mask); + SDL_AtariXbios_InstallVectors(vectors_mask); } void -AtariGemdos_PumpEvents (_THIS) +AtariGemdos_PumpEvents(_THIS) { int i; SDL_keysym keysym; /* Update pressed keys */ - SDL_memset (gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS); + SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS); - while (Cconis () != DEV_BUSY) { + while (Cconis() != DEV_BUSY) { unsigned long key_pressed; unsigned char scancode, asciicode; - key_pressed = Cnecin (); + key_pressed = Cnecin(); asciicode = key_pressed; scancode = key_pressed >> 16; @@ -146,36 +146,36 @@ } /* Read special keys */ - UpdateSpecialKeys (Kbshift (-1)); + UpdateSpecialKeys(Kbshift(-1)); /* Now generate events */ for (i = 0; i < ATARIBIOS_MAXKEYS; i++) { /* Key pressed ? */ if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i]) - SDL_PrivateKeyboard (SDL_PRESSED, - TranslateKey (i, gemdos_currentascii[i], - &keysym, SDL_TRUE)); + SDL_PrivateKeyboard(SDL_PRESSED, + TranslateKey(i, gemdos_currentascii[i], + &keysym, SDL_TRUE)); /* Key unpressed ? */ if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i]) - SDL_PrivateKeyboard (SDL_RELEASED, - TranslateKey (i, gemdos_currentascii[i], - &keysym, SDL_FALSE)); + SDL_PrivateKeyboard(SDL_RELEASED, + TranslateKey(i, gemdos_currentascii[i], + &keysym, SDL_FALSE)); } if (use_dev_mouse) { - SDL_AtariDevMouse_PostMouseEvents (this, SDL_TRUE); + SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE); } else { - SDL_AtariXbios_PostMouseEvents (this, SDL_TRUE); + SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE); } /* Will be previous table */ - SDL_memcpy (gemdos_previouskeyboard, gemdos_currentkeyboard, - ATARIBIOS_MAXKEYS); + SDL_memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, + ATARIBIOS_MAXKEYS); } static void -UpdateSpecialKeys (int special_keys_state) +UpdateSpecialKeys(int special_keys_state) { #define UPDATE_SPECIAL_KEYS(numbit,scancode) \ { \ @@ -185,16 +185,16 @@ } \ } - UPDATE_SPECIAL_KEYS (K_RSHIFT, SCANCODE_RIGHTSHIFT); - UPDATE_SPECIAL_KEYS (K_LSHIFT, SCANCODE_LEFTSHIFT); - UPDATE_SPECIAL_KEYS (K_CTRL, SCANCODE_LEFTCONTROL); - UPDATE_SPECIAL_KEYS (K_ALT, SCANCODE_LEFTALT); - UPDATE_SPECIAL_KEYS (K_CAPSLOCK, SCANCODE_CAPSLOCK); + UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT); + UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT); + UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL); + UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT); + UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK); } static SDL_keysym * -TranslateKey (int scancode, int asciicode, SDL_keysym * keysym, - SDL_bool pressed) +TranslateKey(int scancode, int asciicode, SDL_keysym * keysym, + SDL_bool pressed) { /* Set the keysym information */ keysym->scancode = scancode; @@ -214,11 +214,11 @@ } void -AtariGemdos_ShutdownEvents (void) +AtariGemdos_ShutdownEvents(void) { - SDL_AtariXbios_RestoreVectors (); + SDL_AtariXbios_RestoreVectors(); if (use_dev_mouse) { - SDL_AtariDevMouse_Close (); + SDL_AtariDevMouse_Close(); } }