ReactOS  0.4.15-dev-1184-g23e04ae
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:
83  switch (GetWindowLongPtr((HWND) lParam, GWL_ID))
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 }
static UINT nSpeedArray[SPEEDTICKS]
Definition: mouse.c:15
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
DWORD iTimeToMaxSpeed
Definition: winuser.h:3389
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
#define MKF_REPLACENUMBERS
Definition: winuser.h:2130
#define GWL_ID
Definition: winuser.h:853
#define TBM_SETRANGE
Definition: commctrl.h:2033
#define MKF_HOTKEYACTIVE
Definition: winuser.h:2125
DWORD dwFlags
Definition: winuser.h:3387
#define MKF_INDICATOR
Definition: winuser.h:2127
#define TBM_SETPOS
Definition: commctrl.h:2032
#define SendDlgItemMessage
Definition: winuser.h:5817
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDC_MOUSEKEYS_OFF_RADIO
Definition: resource.h:98
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
#define FALSE
Definition: types.h:117
#define TBM_GETPOS
Definition: commctrl.h:2027
#define ACCELTICKS
Definition: mouse.c:13
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define IDC_MOUSEKEYS_ACCEL_TRACK
Definition: resource.h:95
DWORD iMaxSpeed
Definition: winuser.h:3388
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define IDC_MOUSEKEYS_SPEED_CHECK
Definition: resource.h:96
#define IDC_MOUSEKEYS_ACTIVATE_CHECK
Definition: resource.h:93
MOUSEKEYS mouseKeys
Definition: access.h:50
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
#define SPEEDTICKS
Definition: mouse.c:12
#define IDC_MOUSEKEYS_SPEED_TRACK
Definition: resource.h:94
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_HSCROLL
Definition: winuser.h:1725
#define IDC_MOUSEKEYS_STATUS_CHECK
Definition: resource.h:99
#define BST_CHECKED
Definition: winuser.h:197
struct _GLOBAL_DATA * PGLOBAL_DATA
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define IDC_MOUSEKEYS_ON_RADIO
Definition: resource.h:97
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define MKF_MODIFIERS
Definition: winuser.h:2129

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 MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1386
struct _PSHNOTIFY * LPPSHNOTIFY
#define TRUE
Definition: types.h:120
#define IDC_MOUSE_BOX
Definition: resource.h:49
#define SystemParametersInfo
Definition: winuser.h:5833
DWORD dwFlags
Definition: winuser.h:3387
HINSTANCE hApplet
Definition: access.c:17
#define PSN_APPLY
Definition: prsht.h:117
#define IDC_MOUSE_BUTTON
Definition: resource.h:50
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDD_MOUSEKEYSOPTIONS
Definition: resource.h:19
UINT code
Definition: winuser.h:3134
NMHDR hdr
Definition: prsht.h:330
#define FALSE
Definition: types.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define DialogBoxParam
Definition: winuser.h:5739
MOUSEKEYS mouseKeys
Definition: access.h:50
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1722
#define BST_UNCHECKED
Definition: winuser.h:199
HWND WINAPI GetParent(_In_ HWND)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
INT_PTR CALLBACK MouseKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mouse.c:19
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define BST_CHECKED
Definition: winuser.h:197
struct _GLOBAL_DATA * PGLOBAL_DATA
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
#define MKF_MOUSEKEYSON
Definition: winuser.h:2128

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().