# HG changeset patch # User Sam Lantinga # Date 1032156886 0 # Node ID da6a7e8596160961687d3002c47ace7d0670f646 # Parent 7e53d17ec798a5ffd3b8d53cfb45698a010cf642 Applied John Popplewell's fix for left-handed mice under Windows. diff -r 7e53d17ec798 -r da6a7e859616 src/video/windx5/SDL_dx5events.c --- a/src/video/windx5/SDL_dx5events.c Mon Sep 09 05:28:06 2002 +0000 +++ b/src/video/windx5/SDL_dx5events.c Mon Sep 16 06:14:46 2002 +0000 @@ -58,6 +58,7 @@ static int SDL_DIndev = 0; static int mouse_lost; static int mouse_pressed; +static int mouse_buttons_swapped = 0; /* The translation table from a DirectInput scancode to an SDL keysym */ static SDLKey DIK_keymap[256]; @@ -216,6 +217,7 @@ ++SDL_DIndev; } mouse_pressed = 0; + mouse_buttons_swapped = GetSystemMetrics(SM_SWAPBUTTON); /* DirectInput is ready! */ return(0); @@ -340,6 +342,11 @@ } state = SDL_RELEASED; } + if ( mouse_buttons_swapped ) { + if ( button == 1 ) button = 3; + else + if ( button == 3 ) button = 1; + } posted = SDL_PrivateMouseButton(state, button, 0, 0); } @@ -411,6 +418,11 @@ } state = SDL_RELEASED; } + if ( mouse_buttons_swapped ) { + if ( button == 1 ) button = 3; + else + if ( button == 3 ) button = 1; + } posted = SDL_PrivateMouseButton(state, button, 0, 0); break;