Make the SwapMouseButton function and the SPI_SETMOUSEBUTTONSWAP
parameter work on the same flag.

diff --git a/dlls/user/sysparams.c b/dlls/user/sysparams.c
index 0918f0b..b50c1d0 100644
--- a/dlls/user/sysparams.c
+++ b/dlls/user/sysparams.c
@@ -2683,6 +2683,15 @@
 }
 
 
+/***********************************************************************
+ *		SwapMouseButton (USER32.@)
+ */
+BOOL WINAPI SwapMouseButton( BOOL fSwap )
+{
+    return SystemParametersInfoW(SPI_SETMOUSEBUTTONSWAP, fSwap, 0, 0);
+}
+
+
 /**********************************************************************
  *		SetDoubleClickTime (USER32.@)
  */
diff --git a/windows/input.c b/windows/input.c
index 8666546..228cb24 100644
--- a/windows/input.c
+++ b/windows/input.c
@@ -52,12 +52,10 @@
 WINE_DECLARE_DEBUG_CHANNEL(win);
 WINE_DEFAULT_DEBUG_CHANNEL(event);
 
-static BOOL SwappedButtons;
-
 BYTE InputKeyStateTable[256];
-BYTE AsyncKeyStateTable[256];
-BYTE TrackSysKey = 0; /* determine whether ALT key up will cause a WM_SYSKEYUP
-                         or a WM_KEYUP message */
+static BYTE AsyncKeyStateTable[256];
+static BYTE TrackSysKey = 0; /* determine whether ALT key up will cause a WM_SYSKEYUP
+                                or a WM_KEYUP message */
 
 /* Storage for the USER-maintained mouse positions */
 static DWORD PosX, PosY;
@@ -91,7 +89,7 @@
 {
     WORD ret = 0;
 
-    if (SwappedButtons)
+    if (GetSystemMetrics( SM_SWAPBUTTON ))
     {
         if (InputKeyStateTable[VK_RBUTTON] & 0x80) ret |= MK_LBUTTON;
         if (InputKeyStateTable[VK_LBUTTON] & 0x80) ret |= MK_RBUTTON;
@@ -292,26 +290,26 @@
     {
         InputKeyStateTable[VK_LBUTTON] |= 0x80;
         AsyncKeyStateTable[VK_LBUTTON] |= 0x80;
-        queue_raw_mouse_message( SwappedButtons ? WM_RBUTTONDOWN : WM_LBUTTONDOWN,
+        queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_RBUTTONDOWN : WM_LBUTTONDOWN,
                                  flags, PosX, PosY, mi );
     }
     if (mi->dwFlags & MOUSEEVENTF_LEFTUP)
     {
         InputKeyStateTable[VK_LBUTTON] &= ~0x80;
-        queue_raw_mouse_message( SwappedButtons ? WM_RBUTTONUP : WM_LBUTTONUP,
+        queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_RBUTTONUP : WM_LBUTTONUP,
                                  flags, PosX, PosY, mi );
     }
     if (mi->dwFlags & MOUSEEVENTF_RIGHTDOWN)
     {
         InputKeyStateTable[VK_RBUTTON] |= 0x80;
         AsyncKeyStateTable[VK_RBUTTON] |= 0x80;
-        queue_raw_mouse_message( SwappedButtons ? WM_LBUTTONDOWN : WM_RBUTTONDOWN,
+        queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_LBUTTONDOWN : WM_RBUTTONDOWN,
                                  flags, PosX, PosY, mi );
     }
     if (mi->dwFlags & MOUSEEVENTF_RIGHTUP)
     {
         InputKeyStateTable[VK_RBUTTON] &= ~0x80;
-        queue_raw_mouse_message( SwappedButtons ? WM_LBUTTONUP : WM_RBUTTONUP,
+        queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_LBUTTONUP : WM_RBUTTONUP,
                                  flags, PosX, PosY, mi );
     }
     if (mi->dwFlags & MOUSEEVENTF_MIDDLEDOWN)
@@ -402,17 +400,6 @@
 
 
 /***********************************************************************
- *		SwapMouseButton (USER32.@)
- */
-BOOL WINAPI SwapMouseButton( BOOL fSwap )
-{
-    BOOL ret = SwappedButtons;
-    SwappedButtons = fSwap;
-    return ret;
-}
-
-
-/***********************************************************************
  *		GetCursorPos (USER32.@)
  */
 BOOL WINAPI GetCursorPos( POINT *pt )