ReactOS 0.4.16-dev-109-gf4cb10f
mouse.c File Reference
#include "access.h"
Include dependency graph for mouse.c:

Go to the source code of this file.

Macros

#define SPEEDTICKS   9
 
#define ACCELTICKS   9
 

Functions

INT_PTR CALLBACK MouseKeysDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK MousePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static UINT nSpeedArray [SPEEDTICKS] = {10, 20, 30, 40, 60, 80, 120, 180, 360}
 

Macro Definition Documentation

◆ ACCELTICKS

#define ACCELTICKS   9

Definition at line 13 of file mouse.c.

◆ SPEEDTICKS

#define SPEEDTICKS   9

Definition at line 12 of file mouse.c.

Function Documentation

◆ MouseKeysDlgProc()

INT_PTR CALLBACK MouseKeysDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 19 of file mouse.c.

23{
24 PGLOBAL_DATA pGlobalData;
25 INT i;
26
27 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
28
29 switch (uMsg)
30 {
31 case WM_INITDIALOG:
32 pGlobalData = (PGLOBAL_DATA)lParam;
33 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
34
35 CheckDlgButton(hwndDlg,
38
39 /* Set the number of ticks for the speed trackbar */
41 TRUE, MAKELONG(0, SPEEDTICKS - 1));
42
43 /* Calculate the matching tick */
44 for (i = 0; i < SPEEDTICKS; i++)
45 {
46 if (pGlobalData->mouseKeys.iMaxSpeed <= nSpeedArray[i])
47 break;
48 }
49
50 /* Set the thumb */
52
53 /* Set the number of ticks for the acceleration trackbar */
55 TRUE, MAKELONG(0, ACCELTICKS - 1));
56
57 /* Calculate the matching tick */
58 i = (ACCELTICKS + 1) - pGlobalData->mouseKeys.iTimeToMaxSpeed / 500;
59 if (i > ACCELTICKS - 1)
60 i = ACCELTICKS - 1;
61
62 if (i < 0)
63 i = 0;
64
65 /* Set the thumb */
67
68 CheckDlgButton(hwndDlg,
71
72 CheckRadioButton(hwndDlg,
76
77 CheckDlgButton(hwndDlg,
80 break;
81
82 case WM_HSCROLL:
84 {
87 if (i >= 0 && i < SPEEDTICKS)
88 pGlobalData->mouseKeys.iMaxSpeed = nSpeedArray[i];
89 break;
90
93 if (i >= 0 && i < ACCELTICKS)
94 pGlobalData->mouseKeys.iTimeToMaxSpeed = (ACCELTICKS + 1 - i) * 500;
95 break;
96 }
97 break;
98
99 case WM_COMMAND:
100 switch (LOWORD(wParam))
101 {
103 pGlobalData->mouseKeys.dwFlags ^= MKF_HOTKEYACTIVE;
104 break;
105
107 pGlobalData->mouseKeys.dwFlags ^= MKF_MODIFIERS;
108 break;
109
111 pGlobalData->mouseKeys.dwFlags |= MKF_REPLACENUMBERS;
112 break;
113
115 pGlobalData->mouseKeys.dwFlags &= ~MKF_REPLACENUMBERS;
116 break;
117
119 pGlobalData->mouseKeys.dwFlags ^= MKF_INDICATOR;
120 break;
121
122 case IDOK:
123 EndDialog(hwndDlg, TRUE);
124 break;
125
126 case IDCANCEL:
127 EndDialog(hwndDlg, FALSE);
128 break;
129
130 default:
131 break;
132 }
133 break;
134 }
135
136 return FALSE;
137}
struct _GLOBAL_DATA * PGLOBAL_DATA
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ACCELTICKS
Definition: mouse.c:13
static UINT nSpeedArray[SPEEDTICKS]
Definition: mouse.c:15
#define SPEEDTICKS
Definition: mouse.c:12
#define IDC_MOUSEKEYS_ACTIVATE_CHECK
Definition: resource.h:93
#define IDC_MOUSEKEYS_OFF_RADIO
Definition: resource.h:98
#define IDC_MOUSEKEYS_SPEED_CHECK
Definition: resource.h:96
#define IDC_MOUSEKEYS_STATUS_CHECK
Definition: resource.h:99
#define IDC_MOUSEKEYS_ON_RADIO
Definition: resource.h:97
#define IDC_MOUSEKEYS_SPEED_TRACK
Definition: resource.h:94
#define IDC_MOUSEKEYS_ACCEL_TRACK
Definition: resource.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
if(dx< 0)
Definition: linetemp.h:194
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define TBM_GETPOS
Definition: commctrl.h:2036
#define TBM_SETRANGE
Definition: commctrl.h:2042
#define TBM_SETPOS
Definition: commctrl.h:2041
MOUSEKEYS mouseKeys
Definition: access.h:50
DWORD iMaxSpeed
Definition: winuser.h:3416
DWORD iTimeToMaxSpeed
Definition: winuser.h:3417
DWORD dwFlags
Definition: winuser.h:3415
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define DWLP_USER
Definition: winuser.h:875
#define WM_HSCROLL
Definition: winuser.h:1746
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define IDCANCEL
Definition: winuser.h:834
#define BST_UNCHECKED
Definition: winuser.h:199
#define GWL_ID
Definition: winuser.h:862
#define WM_COMMAND
Definition: winuser.h:1743
#define MKF_MODIFIERS
Definition: winuser.h:2151
#define WM_INITDIALOG
Definition: winuser.h:1742
#define MKF_HOTKEYACTIVE
Definition: winuser.h:2147
#define IDOK
Definition: winuser.h:833
#define MKF_INDICATOR
Definition: winuser.h:2150
#define MKF_REPLACENUMBERS
Definition: winuser.h:2152
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define SendDlgItemMessage
Definition: winuser.h:5854
#define BST_CHECKED
Definition: winuser.h:197
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by MousePageProc().

◆ MousePageProc()

INT_PTR CALLBACK MousePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 142 of file mouse.c.

146{
147 PGLOBAL_DATA pGlobalData;
148 LPPSHNOTIFY lppsn;
149
150 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
151
152 switch (uMsg)
153 {
154 case WM_INITDIALOG:
155 pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
156 if (pGlobalData == NULL)
157 return FALSE;
158
159 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
160
161 /* Set the checkbox */
162 CheckDlgButton(hwndDlg,
165 return TRUE;
166
167
168 case WM_COMMAND:
169 switch (LOWORD(wParam))
170 {
171 case IDC_MOUSE_BOX:
172 pGlobalData->mouseKeys.dwFlags ^= MKF_MOUSEKEYSON;
173 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
174 break;
175
176 case IDC_MOUSE_BUTTON:
179 hwndDlg,
181 (LPARAM)pGlobalData))
182 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
183 break;
184
185 default:
186 break;
187 }
188 break;
189
190 case WM_NOTIFY:
191 lppsn = (LPPSHNOTIFY)lParam;
192 if (lppsn->hdr.code == PSN_APPLY)
193 {
195 sizeof(MOUSEKEYS),
196 &pGlobalData->mouseKeys,
198 return TRUE;
199 }
200 break;
201 }
202
203 return FALSE;
204}
#define NULL
Definition: types.h:112
HINSTANCE hApplet
Definition: access.c:17
INT_PTR CALLBACK MouseKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mouse.c:19
#define IDD_MOUSEKEYSOPTIONS
Definition: resource.h:19
#define IDC_MOUSE_BUTTON
Definition: resource.h:50
#define IDC_MOUSE_BOX
Definition: resource.h:49
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
struct _PSHNOTIFY * LPPSHNOTIFY
#define WM_NOTIFY
Definition: richedit.h:61
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3162
LONG_PTR LPARAM
Definition: windef.h:208
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1407
#define DialogBoxParam
Definition: winuser.h:5776
#define SPIF_SENDCHANGE
Definition: winuser.h:1575
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1574
HWND WINAPI GetParent(_In_ HWND)
#define SystemParametersInfo
Definition: winuser.h:5870
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define MKF_MOUSEKEYSON
Definition: winuser.h:2145

Referenced by SystemApplet().

Variable Documentation

◆ nSpeedArray

UINT nSpeedArray[SPEEDTICKS] = {10, 20, 30, 40, 60, 80, 120, 180, 360}
static

Definition at line 15 of file mouse.c.

Referenced by MouseKeysDlgProc().