[ros-diffs] [ekohl] 26505: - Implement the mouse speed and acceleration settings. - Update mouse option settings only if they have changed.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Wed Apr 25 17:22:44 CEST 2007


Author: ekohl
Date: Wed Apr 25 19:22:44 2007
New Revision: 26505

URL: http://svn.reactos.org/svn/reactos?rev=26505&view=rev
Log:
- Implement the mouse speed and acceleration settings.
- Update mouse option settings only if they have changed.

Modified:
    trunk/reactos/dll/cpl/main/lang/cs-CZ.rc
    trunk/reactos/dll/cpl/main/lang/de-DE.rc
    trunk/reactos/dll/cpl/main/lang/en-US.rc
    trunk/reactos/dll/cpl/main/lang/es-ES.rc
    trunk/reactos/dll/cpl/main/lang/fr-FR.rc
    trunk/reactos/dll/cpl/main/lang/hu-HU.rc
    trunk/reactos/dll/cpl/main/lang/id-ID.rc
    trunk/reactos/dll/cpl/main/lang/it-IT.rc
    trunk/reactos/dll/cpl/main/lang/ja-JP.rc
    trunk/reactos/dll/cpl/main/lang/nl-NL.rc
    trunk/reactos/dll/cpl/main/lang/pl-PL.rc
    trunk/reactos/dll/cpl/main/lang/ru-RU.rc
    trunk/reactos/dll/cpl/main/lang/uk-UA.rc
    trunk/reactos/dll/cpl/main/mouse.c
    trunk/reactos/dll/cpl/main/resource.h

Modified: trunk/reactos/dll/cpl/main/lang/cs-CZ.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/cs-CZ.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/cs-CZ.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/cs-CZ.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Pohyb", -1, 5, 5, 230, 60
   LTEXT "&Vyberte rychlost ukazatele:", -1, 60, 15, 110, 10
   LTEXT "Malá", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Velká", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Zvýšit pøesnost ukazatele.", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Pøichytit", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/de-DE.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/de-DE.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/de-DE.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/de-DE.rc Wed Apr 25 19:22:44 2007
@@ -99,15 +99,15 @@
 
 IDD_PAGE_OPTION DIALOGEX 0, 0, 246, 228
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION
-CAPTION "Zeiger Optionen"
+CAPTION "Zeigeroptionen"
 FONT 8, "MS Shell Dlg"
 BEGIN
   GROUPBOX "Bewegung", -1, 5, 5, 230, 60
   LTEXT "&Zeigergeschwindigkeit auswählen:", -1, 60, 15, 110, 10
   LTEXT "Langsam", -1, 60, 30, 29, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Schnell", -1, 170, 30, 23, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "Z&eigerbeschleunigung verbessern", IDC_CHECK_POINTER_PRECISION, 60, 50, 121, 10
   GROUPBOX "Zur Standardschaltfläche springen", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/en-US.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/en-US.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/en-US.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10
   LTEXT "Slow", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Fast", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Snap To", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/es-ES.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/es-ES.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/es-ES.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/es-ES.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10
   LTEXT "Slow", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Fast", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Snap To", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/fr-FR.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/fr-FR.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/fr-FR.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/fr-FR.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Mouvement", -1, 5, 5, 230, 60
   LTEXT "Séle&ctionner une vitesse de curseur :", -1, 40, 15, 120, 10
   LTEXT "Lent", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Rapide", -1, 170, 30, 30, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Augmenter la précision du pointeur", IDC_CHECK_POINTER_PRECISION, 40, 50, 130, 10
   GROUPBOX "Accrocher", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 40, 80, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/hu-HU.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/hu-HU.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/hu-HU.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/hu-HU.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10
   LTEXT "Slow", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Fast", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Snap To", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/id-ID.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/id-ID.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/id-ID.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/id-ID.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Gerakan", -1, 5, 5, 230, 60
   LTEXT "Pilih ke&cepatan pointer:", -1, 60, 15, 110, 10
   LTEXT "Lambat", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Cepat", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Naikkan ketepatan pointer", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Menempel Ke", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/it-IT.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/it-IT.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/it-IT.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/it-IT.rc Wed Apr 25 19:22:44 2007
@@ -106,9 +106,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Scegli una velocità per il puntatore:", -1, 60, 15, 110, 10
   LTEXT "Lento", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Veloce", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Aumenta la precisione del puntatore", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Salta a", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/ja-JP.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/ja-JP.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/ja-JP.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/ja-JP.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10
   LTEXT "Slow", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Fast", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Snap To", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/nl-NL.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/nl-NL.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/nl-NL.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/nl-NL.rc Wed Apr 25 19:22:44 2007
@@ -103,9 +103,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10
   LTEXT "Slow", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Fast", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Snap To", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/pl-PL.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/pl-PL.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/pl-PL.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/pl-PL.rc Wed Apr 25 19:22:44 2007
@@ -110,9 +110,9 @@
   GROUPBOX "Ruch", -1, 5, 5, 230, 60
   LTEXT "&Wybierz szybkoœæ wskaŸnika:", -1, 60, 15, 110, 10
   LTEXT "Wolno", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Szybko", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "Zwiêksz pr&ecyzjê wskaŸnika", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Przyci¹ganie do", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/ru-RU.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/ru-RU.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/ru-RU.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/ru-RU.rc Wed Apr 25 19:22:44 2007
@@ -104,9 +104,9 @@
   GROUPBOX "Motion", -1, 5, 5, 230, 60
   LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10
   LTEXT "Slow", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Fast", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Snap To", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/lang/uk-UA.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/lang/uk-UA.rc?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/lang/uk-UA.rc (original)
+++ trunk/reactos/dll/cpl/main/lang/uk-UA.rc Wed Apr 25 19:22:44 2007
@@ -112,9 +112,9 @@
   GROUPBOX "Ïåðåì³ùåííÿ", -1, 5, 5, 230, 60
   LTEXT "&Âèáåð³òü øâèäê³ñòü ðóõó âêàç³âíèêà:", -1, 60, 15, 110, 10
   LTEXT "ꏾ֌", -1, 60, 30, 20, 10
-  CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
+  CONTROL "",IDC_SLIDER_MOUSE_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17
   LTEXT "Âèùå", -1, 170, 30, 20, 10
-  ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15
+  ICON -1, IDC_ICON_MOUSE_SPEED, 15, 15, 15, 15
   CHECKBOX "&ϳäâèùåíà òî÷í³ñòü âêàç³âíèêà", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10
   GROUPBOX "Ïðèâ'ÿçêà äî", -1, 5, 65, 230, 40
   CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10

Modified: trunk/reactos/dll/cpl/main/mouse.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/mouse.c (original)
+++ trunk/reactos/dll/cpl/main/mouse.c Wed Apr 25 19:22:44 2007
@@ -47,7 +47,8 @@
 
 #define DEFAULT_DOUBLE_CLICK_SPEED	500
 #define DEFAULT_CLICK_LOCK_TIME		2200
-#define DEFAULT_MOUSE_SENSITIVITY	16
+#define DEFAULT_MOUSE_SPEED		10
+#define DEFAULT_MOUSE_ACCELERATION	1
 #define DEFAULT_MOUSE_THRESHOLD1	6
 #define DEFAULT_MOUSE_THRESHOLD2	10
 #define MIN_DOUBLE_CLICK_SPEED		200
@@ -83,19 +84,32 @@
 } POINTER_DATA, *PPOINTER_DATA;
 
 
+typedef struct _MOUSE_ACCEL
+{
+    INT nThreshold1;
+    INT nThreshold2;
+    INT nAcceleration;
+} MOUSE_ACCEL;
+
 typedef struct _OPTION_DATA
 {
-    ULONG ulMouseSensitivity;
-    ULONG ulOrigMouseSensitivity;
-
-    ULONG ulMouseSpeed; // = 1;
-    ULONG ulMouseThreshold1; // = DEFAULT_MOUSE_THRESHOLD1;
-    ULONG ulMouseThreshold2; // = DEFAULT_MOUSE_THRESHOLD2;
-
-    ULONG ulSnapToDefaultButton;
-    ULONG ulMouseTrails;
-    ULONG ulShowPointer;
-    ULONG ulHidePointer;
+    ULONG ulMouseSpeed;
+    ULONG ulOrigMouseSpeed;
+
+    MOUSE_ACCEL MouseAccel;
+    MOUSE_ACCEL OrigMouseAccel;
+
+    BOOL bSnapToDefaultButton;
+    BOOL bOrigSnapToDefaultButton;
+
+    UINT uMouseTrails;
+    UINT uOrigMouseTrails;
+
+    BOOL bMouseVanish;
+    BOOL bOrigMouseVanish;
+
+    BOOL bMouseSonar;
+    BOOL bOrigMouseSonar;
 } OPTION_DATA, *POPTION_DATA;
 
 
@@ -313,7 +327,7 @@
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
                         SendDlgItemMessage(hwndDlg, IDC_IMAGE_SWAP_MOUSE, STM_SETIMAGE, IMAGE_ICON, (LPARAM)pButtonData->hButtonRight);
                     }
-                    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_SwapMouseButtons, NULL, SPIF_SENDCHANGE);
+                    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_SwapMouseButtons, NULL, 0);
                     PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                     break;
 
@@ -329,8 +343,8 @@
                     else if (lResult == BST_UNCHECKED)
                     {
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+                        pButtonData->g_ClickLockEnabled = TRUE;
                         EnableWindow(hDlgCtrl, TRUE);
-                        pButtonData->g_ClickLockEnabled = TRUE;
                     }
                     PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                     break;
@@ -354,20 +368,25 @@
             lppsn = (LPPSHNOTIFY) lParam;
             if (lppsn->hdr.code == PSN_APPLY)
             {
+                if (pButtonData->g_OrigSwapMouseButtons != pButtonData->g_SwapMouseButtons)
+                {
+                    SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_OrigSwapMouseButtons, NULL, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pButtonData->g_OrigSwapMouseButtons = pButtonData->g_SwapMouseButtons;
+                }
+
 #if (WINVER >= 0x0500)
                 SystemParametersInfo(SPI_SETMOUSECLICKLOCK, pButtonData->g_ClickLockEnabled, NULL, SPIF_SENDCHANGE);
                 if (pButtonData->g_ClickLockEnabled)
                    SystemParametersInfo(SPI_SETMOUSECLICKLOCKTIME, pButtonData->g_ClickLockTime, NULL, SPIF_SENDCHANGE);
 #endif
-                SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR);
             }
             else if (lppsn->hdr.code == PSN_RESET)
             {
                 /* Reset swap mouse button setting */
-                SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_OrigSwapMouseButtons, NULL, SPIF_SENDCHANGE);
+                SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, pButtonData->g_OrigSwapMouseButtons, NULL, 0);
 
                 /* Reset double click speed setting */
-//                SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_OrigDoubleClickSpeed, NULL, SPIF_SENDCHANGE);
+//                SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_OrigDoubleClickSpeed, NULL, 0);
                 SetDoubleClickTime(pButtonData->g_OrigDoubleClickSpeed);
             }
             return TRUE;
@@ -386,14 +405,14 @@
                     case TB_ENDTRACK:
                         lResult = SendDlgItemMessage(hwndDlg, IDC_SLIDER_DOUBLE_CLICK_SPEED, TBM_GETPOS, 0, 0);
                         pButtonData->g_DoubleClickSpeed = (14 - (INT)lResult) * 50 + 200;
-//                        SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_DoubleClickSpeed, NULL, SPIF_SENDCHANGE);
+//                        SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_DoubleClickSpeed, NULL, 0);
                         SetDoubleClickTime(pButtonData->g_DoubleClickSpeed);
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                         break;
 
                     case TB_THUMBTRACK:
                         pButtonData->g_DoubleClickSpeed = (14 - (INT)HIWORD(wParam)) * 50 + 200;
-//                        SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_DoubleClickSpeed, NULL, SPIF_SENDCHANGE);
+//                        SystemParametersInfo(SPI_SETDOUBLECLICKTIME, pButtonData->g_DoubleClickSpeed, NULL, 0);
                         SetDoubleClickTime(pButtonData->g_DoubleClickSpeed);
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                         break;
@@ -1037,16 +1056,20 @@
             if (lppsn->hdr.code == PSN_APPLY)
             {
                 ApplyCursorScheme(hwndDlg);
-#if (WINVER >= 0x0500)
-                SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, SPIF_SENDCHANGE);
-#endif
+//#if (WINVER >= 0x0500)
+                if (pPointerData->bOrigDropShadow != pPointerData->bDropShadow)
+                {
+                    SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pPointerData->bOrigDropShadow = pPointerData->bDropShadow;
+                }
+//#endif
                 return TRUE;
             }
             else if (lppsn->hdr.code == PSN_RESET)
             {
-#if (WINVER >= 0x0500)
-                SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bOrigDropShadow, SPIF_SENDCHANGE);
-#endif
+//#if (WINVER >= 0x0500)
+                SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bOrigDropShadow, 0);
+//#endif
             }
             break;
 
@@ -1134,62 +1157,26 @@
                     {
                         pPointerData->bDropShadow = FALSE;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
-#if (WINVER >= 0x0500)
-                        SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, SPIF_SENDCHANGE);
-#endif
-                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+//#if (WINVER >= 0x0500)
+//                        SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, 0);
+//#endif
+//                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                     }
                     else
                     {
                         pPointerData->bDropShadow = TRUE;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-#if (WINVER >= 0x0500)
-                        SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, SPIF_SENDCHANGE);
-#endif
-                        PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
-                    }
+                    }
+//#if (WINVER >= 0x0500)
+                    SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID)pPointerData->bDropShadow, 0);
+//#endif
+                    PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                     break;
             }
             break;
     }
 
     return FALSE;
-}
-
-
-static BOOL
-InitializeMouse(POPTION_DATA pOptionData)
-{
-    //FIXME
-    //pointer precision
-    // SPI_GETMOUSE?
-
-    /* Get mouse sensitivity */
-    if (!SystemParametersInfo(SPI_GETMOUSESPEED, 0, &pOptionData->ulMouseSensitivity, 0))
-        pOptionData->ulMouseSensitivity = DEFAULT_MOUSE_SENSITIVITY;
-    pOptionData->ulOrigMouseSensitivity = pOptionData->ulMouseSensitivity;
-
-    pOptionData->ulMouseSpeed = 1;
-    pOptionData->ulMouseThreshold1 = DEFAULT_MOUSE_THRESHOLD1;
-    pOptionData->ulMouseThreshold2 = DEFAULT_MOUSE_THRESHOLD2;
-
-    /* snap to default button */
-    if (SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &pOptionData->ulSnapToDefaultButton, 0))
-        pOptionData->ulSnapToDefaultButton = 0;
-
-    /* mouse trails */
-    if (!SystemParametersInfo(SPI_GETMOUSETRAILS, 0, &pOptionData->ulMouseTrails, 0))
-        pOptionData->ulMouseTrails = 0;
-
-    /* hide pointer while typing */
-    if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &pOptionData->ulHidePointer, 0))
-        pOptionData->ulHidePointer = 0;
-
-    /* show pointer with Ctrl-Key */
-    if (!SystemParametersInfo(SPI_GETMOUSESONAR, 0, &pOptionData->ulShowPointer, 0))
-        pOptionData->ulShowPointer = 0;
-
-    return TRUE;
 }
 
 
@@ -1199,10 +1186,9 @@
            IN WPARAM wParam,
            IN LPARAM lParam)
 {
+    POPTION_DATA pOptionData;
     HWND hDlgCtrl;
     LPPSHNOTIFY lppsn;
-    LRESULT lResult;
-    POPTION_DATA pOptionData;
 
     pOptionData = (POPTION_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
 
@@ -1212,20 +1198,54 @@
             pOptionData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OPTION_DATA));
             SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pOptionData);
 
-            InitializeMouse(pOptionData);
-
-            /* set mouse sensitivity */
-            hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SENSITIVITY);
+            /* Get mouse sensitivity */
+            if (!SystemParametersInfo(SPI_GETMOUSESPEED, 0, &pOptionData->ulMouseSpeed, 0))
+                pOptionData->ulMouseSpeed = DEFAULT_MOUSE_SPEED;
+            pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed;
+
+
+            if (!SystemParametersInfo(SPI_GETMOUSE, 0, &pOptionData->MouseAccel, 0))
+            {
+                pOptionData->MouseAccel.nAcceleration = DEFAULT_MOUSE_ACCELERATION;
+                pOptionData->MouseAccel.nThreshold1 = DEFAULT_MOUSE_THRESHOLD1;
+                pOptionData->MouseAccel.nThreshold2 = DEFAULT_MOUSE_THRESHOLD2;
+            }
+            pOptionData->OrigMouseAccel.nAcceleration = pOptionData->MouseAccel.nAcceleration;
+            pOptionData->OrigMouseAccel.nThreshold1 = pOptionData->MouseAccel.nThreshold1;
+            pOptionData->OrigMouseAccel.nThreshold2 = pOptionData->MouseAccel.nThreshold2;
+
+            /* snap to default button */
+            if (SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &pOptionData->bSnapToDefaultButton, 0))
+                pOptionData->bSnapToDefaultButton = FALSE;
+            pOptionData->bOrigSnapToDefaultButton = pOptionData->bSnapToDefaultButton;
+
+            /* mouse trails */
+            if (!SystemParametersInfo(SPI_GETMOUSETRAILS, 0, &pOptionData->uMouseTrails, 0))
+                pOptionData->uMouseTrails = 0;
+            pOptionData->uOrigMouseTrails = pOptionData->uMouseTrails;
+
+            /* hide pointer while typing */
+            if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &pOptionData->bMouseVanish, 0))
+                pOptionData->bMouseVanish = FALSE;
+            pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish;
+
+            /* show pointer with Ctrl-Key */
+            if (!SystemParametersInfo(SPI_GETMOUSESONAR, 0, &pOptionData->bMouseSonar, 0))
+                pOptionData->bMouseSonar = FALSE;
+            pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar;
+
+            /* Set mouse speed */
+            hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SPEED);
             SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 19));
-            SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pOptionData->ulMouseSensitivity - 1);
-
-            if (pOptionData->ulMouseSpeed)
+            SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pOptionData->ulMouseSpeed - 1);
+
+            if (pOptionData->MouseAccel.nAcceleration)
             {
                 hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_POINTER_PRECISION);
                 SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
             }
 
-            if (pOptionData->ulSnapToDefaultButton)
+            if (pOptionData->bSnapToDefaultButton)
             {
                 hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SNAP_TO);
                 SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
@@ -1234,22 +1254,29 @@
             /* set mouse trail */
             hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL);
             SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 5));
-            if (pOptionData->ulMouseTrails < 2)
+            if (pOptionData->uMouseTrails < 2)
+            {
+                SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)5);
                 EnableWindow(hDlgCtrl, FALSE);
+            }
             else
-                SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pOptionData->ulMouseTrails - 2);
-
-            if (pOptionData->ulShowPointer)
+            {
+                SendDlgItemMessage(hwndDlg, IDC_CHECK_POINTER_TRAIL, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+                SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pOptionData->uMouseTrails - 2);
+            }
+
+            if (pOptionData->bMouseVanish)
+            {
+                hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_HIDE_POINTER);
+                SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+            }
+
+            if (pOptionData->bMouseSonar)
             {
                 hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SHOW_POINTER);
                 SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
             }
 
-            if (pOptionData->ulHidePointer)
-            {
-                hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_HIDE_POINTER);
-                SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-            }
             break;
 
         case WM_DESTROY:
@@ -1262,74 +1289,80 @@
                 case IDC_CHECK_POINTER_PRECISION:
                     if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_POINTER_PRECISION))
                     {
-                        pOptionData->ulMouseSpeed = 0;
-                        pOptionData->ulMouseThreshold1 = 0;
-                        pOptionData->ulMouseThreshold2 = 0;
+                        pOptionData->MouseAccel.nAcceleration = 0;
+                        pOptionData->MouseAccel.nThreshold1 = 0;
+                        pOptionData->MouseAccel.nThreshold2 = 0;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
                     }
                     else
                     {
-                        pOptionData->ulMouseSpeed = 1;
-                        pOptionData->ulMouseThreshold1 = 6;
-                        pOptionData->ulMouseThreshold2 = 10;
+                        pOptionData->MouseAccel.nAcceleration = 1;
+                        pOptionData->MouseAccel.nThreshold1 = 6;
+                        pOptionData->MouseAccel.nThreshold2 = 10;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
                     }
+                    SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->MouseAccel, 0);
                     break;
 
                 case IDC_CHECK_SNAP_TO:
                     if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SNAP_TO))
                     {
-                        pOptionData->ulSnapToDefaultButton = 0;
+                        pOptionData->bSnapToDefaultButton = 0;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
                     }
                     else
                     {
-                        pOptionData->ulSnapToDefaultButton = 1;
+                        pOptionData->bSnapToDefaultButton = 1;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
                     }
+                    SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bSnapToDefaultButton, 0, 0);
                     break;
 
                 case IDC_CHECK_POINTER_TRAIL:
                     hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL);
                     if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_POINTER_TRAIL))
                     {
-                        pOptionData->ulMouseTrails = 0;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
                         EnableWindow(hDlgCtrl, FALSE);
+                        pOptionData->uMouseTrails = 0;
                     }
                     else
                     {
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
                         EnableWindow(hDlgCtrl, TRUE);
-                        pOptionData->ulMouseTrails = (ULONG)SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 2;
-                    }
+                        pOptionData->uMouseTrails = (UINT)SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 2;
+                    }
+                    SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, 0);
+                    break;
+
+                case IDC_CHECK_HIDE_POINTER:
+                    if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_HIDE_POINTER))
+                    {
+                        pOptionData->bMouseVanish = FALSE;
+                        SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
+                    }
+                    else
+                    {
+                        pOptionData->bMouseVanish = TRUE;
+                        SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
+                    }
+                    SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->bMouseVanish, 0);
                     break;
 
                 case IDC_CHECK_SHOW_POINTER:
                     if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOW_POINTER))
                     {
-                        pOptionData->ulShowPointer = 0;
+                        pOptionData->bMouseSonar = FALSE;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
                     }
                     else
                     {
-                        pOptionData->ulShowPointer = 1;
+                        pOptionData->bMouseSonar = TRUE;
                         SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
                     }
-                    break;
-
-                case IDC_CHECK_HIDE_POINTER:
-                    if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_HIDE_POINTER))
-                    {
-                        pOptionData->ulHidePointer = 0;
-                        SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0);
-                    }
-                    else
-                    {
-                        pOptionData->ulHidePointer = 1;
-                        SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
-                    }
-                    break;
+                    SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->bMouseSonar, 0);
+                    break;
+
             }
             PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
             break;
@@ -1338,51 +1371,65 @@
             lppsn = (LPPSHNOTIFY)lParam;
             if (lppsn->hdr.code == PSN_APPLY)
             {
+                /* Set mouse speed */
+                if (pOptionData->ulOrigMouseSpeed != pOptionData->ulMouseSpeed)
+                {
+                    SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSpeed, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pOptionData->ulOrigMouseSpeed = pOptionData->ulMouseSpeed;
+                }
+
+                if (pOptionData->OrigMouseAccel.nAcceleration != pOptionData->MouseAccel.nAcceleration)
+                {
+                    SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->MouseAccel, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pOptionData->OrigMouseAccel.nAcceleration = pOptionData->MouseAccel.nAcceleration;
+                    pOptionData->OrigMouseAccel.nThreshold1 = pOptionData->MouseAccel.nThreshold1;
+                    pOptionData->OrigMouseAccel.nThreshold2 = pOptionData->MouseAccel.nThreshold2;
+                }
+
+
                 /* set snap to default button */
-                SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, pOptionData->ulSnapToDefaultButton, 0, SPIF_SENDCHANGE);
-
-#if 0
-                /* set mouse trails */
-                if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_POINTER_TRAIL))
+                if (pOptionData->bOrigSnapToDefaultButton != pOptionData->bSnapToDefaultButton)
                 {
-                    hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL);
-                    lResult = SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 2;
+                    SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bSnapToDefaultButton, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pOptionData->bOrigSnapToDefaultButton = pOptionData->bSnapToDefaultButton;
                 }
-                else
+
+                /* Set mouse trails setting */
+                if (pOptionData->uOrigMouseTrails != pOptionData->uMouseTrails)
                 {
-                    lResult = 0;
+                    SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pOptionData->uOrigMouseTrails = pOptionData->uMouseTrails;
                 }
 
-                SystemParametersInfo(SPI_SETMOUSETRAILS, (UINT) lResult, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
-#endif
-
-                //FIXME
-                //pointer precision
-                //SPI_SETMOUSE?
-
-                /* calc pos and set mouse sensitivity */
-                hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SENSITIVITY);
-                lResult = SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 1;
-                SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSensitivity, SPIF_SENDCHANGE);
-
                 /* hide pointer while typing */
-                SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->ulHidePointer, SPIF_SENDCHANGE);
+                if (pOptionData->bOrigMouseVanish != pOptionData->bMouseVanish)
+                {
+                    SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->bMouseVanish, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pOptionData->bOrigMouseVanish = pOptionData->bMouseVanish;
+                }
 
                 /* show pointer with Ctrl-Key */
-                SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->ulShowPointer, SPIF_SENDCHANGE);
-
-                SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR);
+                if (pOptionData->bOrigMouseSonar != pOptionData->bMouseSonar)
+                {
+                    SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->bMouseSonar, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                    pOptionData->bOrigMouseSonar = pOptionData->bMouseSonar;
+                }
                 return TRUE;
             }
             else if (lppsn->hdr.code == PSN_RESET)
             {
                 /* Set the original mouse speed */
-                SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulOrigMouseSensitivity, SPIF_SENDCHANGE);
+                SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulOrigMouseSpeed, 0);
+                SystemParametersInfo(SPI_SETMOUSE, 0, &pOptionData->OrigMouseAccel, 0);
+                SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, (UINT)pOptionData->bOrigSnapToDefaultButton, 0, 0);
+                SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uOrigMouseTrails, 0, 0);
+                SystemParametersInfo(SPI_SETMOUSEVANISH, 0, (PVOID)pOptionData->bOrigMouseVanish, 0);
+                SystemParametersInfo(SPI_SETMOUSESONAR, 0, (PVOID)pOptionData->bOrigMouseSonar, 0);
             }
             break;
 
         case WM_HSCROLL:
-            if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SENSITIVITY))
+            if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SPEED))
             {
                 switch (LOWORD(wParam))
                 {
@@ -1393,14 +1440,14 @@
                     case TB_TOP:
                     case TB_BOTTOM:
                     case TB_ENDTRACK:
-                        pOptionData->ulMouseSensitivity = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_MOUSE_SENSITIVITY, TBM_GETPOS, 0, 0) + 1;
-                        SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSensitivity, SPIF_SENDCHANGE);
+                        pOptionData->ulMouseSpeed = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_MOUSE_SPEED, TBM_GETPOS, 0, 0) + 1;
+                        SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSpeed, SPIF_SENDCHANGE);
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                         break;
 #if 0
                     case TB_THUMBTRACK:
-                        pOptionData->ulMouseSensitivity = (ULONG)HIWORD(wParam) + 1;
-                        SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSensitivity, SPIF_SENDCHANGE);
+                        pOptionData->ulMouseSpeed = (ULONG)HIWORD(wParam) + 1;
+                        SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)pOptionData->ulMouseSpeed, SPIF_SENDCHANGE);
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                         break;
 #endif
@@ -1417,14 +1464,14 @@
                     case TB_TOP:
                     case TB_BOTTOM:
                     case TB_ENDTRACK:
-                        pOptionData->ulMouseTrails = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_POINTER_TRAIL, TBM_GETPOS, 0, 0) + 2;
-                        SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->ulMouseTrails, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                        pOptionData->uMouseTrails = (ULONG)SendDlgItemMessage(hwndDlg, IDC_SLIDER_POINTER_TRAIL, TBM_GETPOS, 0, 0) + 2;
+                        SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, SPIF_UPDATEINIFILE);
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                         break;
 
                     case TB_THUMBTRACK:
-                        pOptionData->ulMouseTrails = (ULONG)HIWORD(wParam) + 2;
-                        SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->ulMouseTrails, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+                        pOptionData->uMouseTrails = (ULONG)HIWORD(wParam) + 2;
+                        SystemParametersInfo(SPI_SETMOUSETRAILS, pOptionData->uMouseTrails, 0, SPIF_UPDATEINIFILE);
                         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
                         break;
                 }

Modified: trunk/reactos/dll/cpl/main/resource.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/resource.h?rev=26505&r1=26504&r2=26505&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/main/resource.h (original)
+++ trunk/reactos/dll/cpl/main/resource.h Wed Apr 25 19:22:44 2007
@@ -57,7 +57,7 @@
 #define IDC_EDIT_WHEEL_SCROLL_LINES		2005
 #define IDC_UPDOWN_WHEEL_SCROLL_LINES		2006
 #define IDC_RADIO_WHEEL_SCROLL_PAGE		2007
-#define IDC_SLIDER_MOUSE_SENSITIVITY		2008
+#define IDC_SLIDER_MOUSE_SPEED			2008
 #define IDC_CHECK_SNAP_TO			2009
 #define IDC_CHECK_SHOW_POINTER			2010
 #define IDC_CHECK_HIDE_POINTER			2011
@@ -70,7 +70,7 @@
 #define IDC_CHECK_DROP_SHADOW			2034
 #define IDC_IMAGE_SWAP_MOUSE			2035
 #define IDC_IMAGE_DOUBLE_CLICK_SPEED		2036
-#define IDC_ICON_MOUSE_SENSITIVITY		2037
+#define IDC_ICON_MOUSE_SPEED			2037
 #define IDC_ICON_SNAP_TO			2038
 #define IDC_ICON_POINTER_TRAIL			2039
 #define IDC_ICON_SHOW_POINTER			2040




More information about the Ros-diffs mailing list