/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga slouken@libsdl.org */ /* File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability 27 March 2003 Implements keyboard setup, event pump and keyboard and mouse polling */ #include "SDL.h" #include "SDL_sysevents.h" #include "SDL_events_c.h" #include "SDL_riscosvideo.h" #include "SDL_riscosevents_c.h" #include "SDL_timer_c.h" #include "SDL_cursor_c.h" #include "memory.h" #include "stdlib.h" #include "ctype.h" #include "kernel.h" #include "swis.h" /* The translation table from a RISC OS internal key numbers to a SDL keysym */ static SDLKey RO_keymap[SDLK_LAST]; /* RISC OS Key codes */ #define ROKEY_SHIFT 0 #define ROKEY_CTRL 1 #define ROKEY_ALT 2 /* Left shift is first key we will check for */ #define ROKEY_LEFT_SHIFT 3 /* Need to ignore mouse buttons as they are processed separately */ #define ROKEY_LEFT_MOUSE 9 #define ROKEY_CENTRE_MOUSE 10 #define ROKEY_RIGHT_MOUSE 11 /* No key has been pressed return value*/ #define ROKEY_NONE 255 /* Id of last key in keyboard */ #define ROKEY_LAST_KEY 124 /* Size of array for all keys */ #define ROKEYBD_ARRAYSIZE 125 static char RO_pressed[ROKEYBD_ARRAYSIZE]; static SDL_keysym *TranslateKey(int intkey, SDL_keysym *keysym, int pressed); void RISCOS_PollMouse(_THIS); void RISCOS_PollKeyboard(); void RISCOS_PollMouseHelper(_THIS, int fullscreen); #ifdef DISABLE_THREADS extern void DRenderer_FillBuffers(); /* Timer running function */ extern void RISCOS_CheckTimer(); #endif void FULLSCREEN_PumpEvents(_THIS) { /* Current implementation requires keyboard and mouse polling */ RISCOS_PollKeyboard(); RISCOS_PollMouse(this); #ifdef DISABLE_THREADS // DRenderer_FillBuffers(); if (SDL_timer_running) RISCOS_CheckTimer(); #endif } void RISCOS_InitOSKeymap(_THIS) { int i; /* Map the VK keysyms */ for ( i=0; i