src/video/riscos/SDL_riscosevents.c
changeset 1035 974ba6ae0fa3
parent 955 d74fbf56f2f6
child 1312 c9b51268668f
equal deleted inserted replaced
1034:2eca15c3f609 1035:974ba6ae0fa3
    19     Sam Lantinga
    19     Sam Lantinga
    20     slouken@devolution.com
    20     slouken@devolution.com
    21 */
    21 */
    22 
    22 
    23 /*
    23 /*
    24      File added by Alan Buckley (alan_baa@hotmail.com) for RISCOS compatability
    24      File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
    25 	 27 March 2003
    25 	 27 March 2003
    26 
    26 
    27      Implements keyboard setup, event pump and keyboard and mouse polling
    27      Implements keyboard setup, event pump and keyboard and mouse polling
    28 */
    28 */
    29 
    29 
    41 #include "ctype.h"
    41 #include "ctype.h"
    42 
    42 
    43 #include "kernel.h"
    43 #include "kernel.h"
    44 #include "swis.h"
    44 #include "swis.h"
    45 
    45 
    46 /* The translation table from a RISCOS internal key numbers to a SDL keysym */
    46 /* The translation table from a RISC OS internal key numbers to a SDL keysym */
    47 static SDLKey RO_keymap[SDLK_LAST];
    47 static SDLKey RO_keymap[SDLK_LAST];
    48 
    48 
    49 /* RISCOS Key codes */
    49 /* RISC OS Key codes */
    50 #define ROKEY_SHIFT 0
    50 #define ROKEY_SHIFT 0
    51 #define ROKEY_CTRL  1
    51 #define ROKEY_CTRL  1
    52 #define ROKEY_ALT   2
    52 #define ROKEY_ALT   2
    53 /* Left shift is first key we will check for */
    53 /* Left shift is first key we will check for */
    54 #define ROKEY_LEFT_SHIFT 3
    54 #define ROKEY_LEFT_SHIFT 3
    88 {
    88 {
    89     /* Current implementation requires keyboard and mouse polling */
    89     /* Current implementation requires keyboard and mouse polling */
    90 	RISCOS_PollKeyboard();
    90 	RISCOS_PollKeyboard();
    91 	RISCOS_PollMouse(this);
    91 	RISCOS_PollMouse(this);
    92 #ifdef DISABLE_THREADS
    92 #ifdef DISABLE_THREADS
    93 	DRenderer_FillBuffers();
    93 //	DRenderer_FillBuffers();
    94 	if (SDL_timer_running) RISCOS_CheckTimer();
    94 	if (SDL_timer_running) RISCOS_CheckTimer();
    95 #endif
    95 #endif
    96 }
    96 }
    97 
    97 
    98 
    98 
   260     if (_kernel_swi(OS_Mouse, &regs, &regs) == NULL)
   260     if (_kernel_swi(OS_Mouse, &regs, &regs) == NULL)
   261     {
   261     {
   262        Sint16 new_x = regs.r[0]; /* Initialy get as OS units */
   262        Sint16 new_x = regs.r[0]; /* Initialy get as OS units */
   263        Sint16 new_y = regs.r[1];
   263        Sint16 new_y = regs.r[1];
   264 
   264 
   265 /* Discard mouse events until the let go of the mouse after starting */
   265        /* Discard mouse events until they let go of the mouse after starting */
   266        if (starting && regs.r[2] != 0) return;
   266        if (starting && regs.r[2] != 0)
   267        else starting = 0;
   267          return;
       
   268        else
       
   269          starting = 0;
   268 
   270 
   269        if (new_x != last_x || new_y != last_y || last_buttons != regs.r[2])
   271        if (new_x != last_x || new_y != last_y || last_buttons != regs.r[2])
   270        {
   272        {
   271           /* Something changed so generate appropriate events */
   273           /* Something changed so generate appropriate events */
   272           int topLeftX, topLeftY;  /* Top left OS units */
   274           int topLeftX, topLeftY;  /* Top left OS units */