ReactOS 0.4.16-dev-88-ga65b6ae
keyboard.c File Reference
#include "access.h"
Include dependency graph for keyboard.c:

Go to the source code of this file.

Macros

#define BOUNCETICKS   5
 
#define DELAYTICKS   5
 
#define REPEATTICKS   6
 
#define WAITTICKS   10
 

Functions

static VOID EnableFilterKeysTest (PGLOBAL_DATA pGlobalData)
 
static VOID DisableFilterKeysTest (PGLOBAL_DATA pGlobalData)
 
INT_PTR CALLBACK StickyKeysDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID AddComboBoxTime (HWND hwnd, INT nId, INT nTimeMs)
 
INT_PTR CALLBACK BounceKeysDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK RepeatKeysDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK FilterKeysDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK ToggleKeysDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK KeyboardPageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static UINT nBounceArray [BOUNCETICKS] = {500, 700, 1000, 1500, 2000}
 
static UINT nDelayArray [DELAYTICKS] = {300, 700, 1000, 1500, 2000}
 
static UINT nRepeatArray [REPEATTICKS] = {300, 500, 700, 1000, 1500, 2000}
 
static UINT nWaitArray [WAITTICKS] = {0, 300, 500, 700, 1000, 1500, 2000, 5000, 10000, 20000}
 

Macro Definition Documentation

◆ BOUNCETICKS

#define BOUNCETICKS   5

Definition at line 12 of file keyboard.c.

◆ DELAYTICKS

#define DELAYTICKS   5

Definition at line 15 of file keyboard.c.

◆ REPEATTICKS

#define REPEATTICKS   6

Definition at line 18 of file keyboard.c.

◆ WAITTICKS

#define WAITTICKS   10

Definition at line 21 of file keyboard.c.

Function Documentation

◆ AddComboBoxTime()

static VOID AddComboBoxTime ( HWND  hwnd,
INT  nId,
INT  nTimeMs 
)
static

Definition at line 151 of file keyboard.c.

152{
153 TCHAR szBuffer[32];
154 TCHAR szSeconds[20];
155
156 if (LoadString(hApplet, IDS_SECONDS, szSeconds, 20) == 0)
157 lstrcpy(szSeconds, L"Seconds");
158
159 _stprintf(szBuffer, _T("%d.%d %s"),
160 nTimeMs / 1000, (nTimeMs % 1000) / 100,
161 szSeconds);
162
163 SendDlgItemMessage(hwnd, nId, CB_ADDSTRING, 0, (LPARAM)szBuffer);
164}
HINSTANCE hApplet
Definition: access.c:17
#define IDS_SECONDS
Definition: resource.h:30
#define _stprintf
Definition: utility.h:124
#define L(x)
Definition: ntvdm.h:50
#define _T(x)
Definition: vfdio.h:22
#define lstrcpy
Definition: winbase.h:3874
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ADDSTRING
Definition: winuser.h:1939
#define LoadString
Definition: winuser.h:5831
#define SendDlgItemMessage
Definition: winuser.h:5854
char TCHAR
Definition: xmlstorage.h:189

Referenced by BounceKeysDlgProc(), and RepeatKeysDlgProc().

◆ BounceKeysDlgProc()

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

Definition at line 168 of file keyboard.c.

172{
173 PGLOBAL_DATA pGlobalData;
174 INT i, n;
175
176 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
177
178 switch (uMsg)
179 {
180 case WM_INITDIALOG:
181 pGlobalData = (PGLOBAL_DATA)lParam;
182 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
183
184 /* Determine the current bounce time */
185 if (pGlobalData->filterKeys.iBounceMSec == 0)
186 pGlobalData->filterKeys.iBounceMSec = nBounceArray[0];
187
188 for (n = 0; n < BOUNCETICKS; n++)
189 {
190 if (pGlobalData->filterKeys.iBounceMSec < nBounceArray[n])
191 break;
192 }
193 n--;
194
195 for (i = 0; i < BOUNCETICKS; i++)
196 {
198 }
199
201 break;
202
203 case WM_COMMAND:
204 switch (LOWORD(wParam))
205 {
208 {
210 if (i != CB_ERR)
211 {
212 pGlobalData->filterKeys.iBounceMSec = nBounceArray[i];
213 }
214 }
215 break;
216
218 switch (HIWORD(wParam))
219 {
220 case EN_SETFOCUS:
221 EnableFilterKeysTest(pGlobalData);
222 break;
223
224 case EN_KILLFOCUS:
225 DisableFilterKeysTest(pGlobalData);
226 break;
227 }
228 break;
229
230 case IDOK:
231 EndDialog(hwndDlg, TRUE);
232 break;
233
234 case IDCANCEL:
235 EndDialog(hwndDlg, FALSE);
236 break;
237
238 default:
239 break;
240 }
241 break;
242 }
243
244 return FALSE;
245}
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 BOUNCETICKS
Definition: keyboard.c:12
static VOID DisableFilterKeysTest(PGLOBAL_DATA pGlobalData)
Definition: keyboard.c:39
static VOID EnableFilterKeysTest(PGLOBAL_DATA pGlobalData)
Definition: keyboard.c:26
static UINT nBounceArray[BOUNCETICKS]
Definition: keyboard.c:13
static VOID AddComboBoxTime(HWND hwnd, INT nId, INT nTimeMs)
Definition: keyboard.c:151
#define IDC_BOUNCE_TEST_EDIT
Definition: resource.h:76
#define IDC_BOUNCE_TIME_COMBO
Definition: resource.h:75
GLdouble n
Definition: glext.h:7729
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
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
FILTERKEYS filterKeys
Definition: access.h:31
DWORD iBounceMSec
Definition: winuser.h:3363
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
#define DWLP_USER
Definition: winuser.h:875
#define EN_KILLFOCUS
Definition: winuser.h:2028
#define IDCANCEL
Definition: winuser.h:834
#define EN_SETFOCUS
Definition: winuser.h:2030
#define WM_COMMAND
Definition: winuser.h:1743
#define CB_ERR
Definition: winuser.h:2438
#define CB_SETCURSEL
Definition: winuser.h:1964
#define WM_INITDIALOG
Definition: winuser.h:1742
#define IDOK
Definition: winuser.h:833
#define CBN_SELCHANGE
Definition: winuser.h:1982
#define CB_GETCURSEL
Definition: winuser.h:1946
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by FilterKeysDlgProc().

◆ DisableFilterKeysTest()

static VOID DisableFilterKeysTest ( PGLOBAL_DATA  pGlobalData)
static

Definition at line 39 of file keyboard.c.

40{
41 if (pGlobalData->oldFilterKeys.dwFlags & FKF_FILTERKEYSON)
42 {
43 pGlobalData->filterKeys.dwFlags |= FKF_FILTERKEYSON;
44 }
45 else
46 {
47 pGlobalData->filterKeys.dwFlags &= ~FKF_FILTERKEYSON;
48 }
49
50 if (pGlobalData->oldFilterKeys.dwFlags & FKF_INDICATOR)
51 {
52 pGlobalData->filterKeys.dwFlags |= FKF_INDICATOR;
53 }
54 else
55 {
56 pGlobalData->filterKeys.dwFlags &= ~FKF_INDICATOR;
57 }
58
60 sizeof(FILTERKEYS),
61 &pGlobalData->filterKeys,
62 0);
63}
FILTERKEYS oldFilterKeys
Definition: access.h:32
DWORD dwFlags
Definition: winuser.h:3359
#define FKF_INDICATOR
Definition: winuser.h:2136
#define SPI_SETFILTERKEYS
Definition: winuser.h:1403
#define FKF_FILTERKEYSON
Definition: winuser.h:2132
#define SystemParametersInfo
Definition: winuser.h:5870

Referenced by BounceKeysDlgProc(), FilterKeysDlgProc(), and RepeatKeysDlgProc().

◆ EnableFilterKeysTest()

static VOID EnableFilterKeysTest ( PGLOBAL_DATA  pGlobalData)
static

Definition at line 26 of file keyboard.c.

27{
28 pGlobalData->filterKeys.dwFlags |= FKF_FILTERKEYSON;
29 pGlobalData->filterKeys.dwFlags &= ~FKF_INDICATOR;
30
32 sizeof(FILTERKEYS),
33 &pGlobalData->filterKeys,
34 0);
35}

Referenced by BounceKeysDlgProc(), FilterKeysDlgProc(), and RepeatKeysDlgProc().

◆ FilterKeysDlgProc()

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

Definition at line 404 of file keyboard.c.

408{
409 PGLOBAL_DATA pGlobalData;
410
411 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
412
413 switch (uMsg)
414 {
415 case WM_INITDIALOG:
416 pGlobalData = (PGLOBAL_DATA)lParam;
417 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
418
419 memcpy(&pGlobalData->oldFilterKeys,
420 &pGlobalData->filterKeys,
421 sizeof(FILTERKEYS));
422
423 CheckDlgButton(hwndDlg,
426
427 if (pGlobalData->filterKeys.iBounceMSec != 0)
428 {
432 }
433 else
434 {
438 }
439
440 CheckDlgButton(hwndDlg,
443
444 CheckDlgButton(hwndDlg,
447 break;
448
449 case WM_COMMAND:
450 switch (LOWORD(wParam))
451 {
453 pGlobalData->filterKeys.dwFlags ^= FKF_HOTKEYACTIVE;
454 break;
455
459 break;
460
464 break;
465
469 hwndDlg,
471 (LPARAM)pGlobalData);
472 break;
473
475 switch (HIWORD(wParam))
476 {
477 case EN_SETFOCUS:
478 EnableFilterKeysTest(pGlobalData);
479 break;
480
481 case EN_KILLFOCUS:
482 DisableFilterKeysTest(pGlobalData);
483 break;
484 }
485 break;
486
488 pGlobalData->filterKeys.dwFlags ^= FKF_CLICKON;
489 break;
490
494 hwndDlg,
496 (LPARAM)pGlobalData);
497 break;
498
500 pGlobalData->filterKeys.dwFlags ^= FKF_INDICATOR;
501 break;
502
503 case IDOK:
504 EndDialog(hwndDlg,
505 (pGlobalData->filterKeys.dwFlags != pGlobalData->oldFilterKeys.dwFlags));
506 break;
507
508 case IDCANCEL:
509 EndDialog(hwndDlg, FALSE);
510 break;
511
512 default:
513 break;
514 }
515 break;
516 }
517
518 return FALSE;
519}
INT_PTR CALLBACK BounceKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:168
INT_PTR CALLBACK RepeatKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:249
#define IDC_FILTER_REPEAT_BUTTON
Definition: resource.h:70
#define IDC_FILTER_REPEAT_RADIO
Definition: resource.h:68
#define IDC_FILTER_BOUNCE_RADIO
Definition: resource.h:67
#define IDC_FILTER_ACTIVATE_CHECK
Definition: resource.h:66
#define IDC_FILTER_SOUND_CHECK
Definition: resource.h:72
#define IDC_FILTER_TEST_EDIT
Definition: resource.h:71
#define IDD_BOUNCEKEYSOPTIONS
Definition: resource.h:14
#define IDD_REPEATKEYSOPTIONS
Definition: resource.h:15
#define IDC_FILTER_BOUNCE_BUTTON
Definition: resource.h:69
#define IDC_FILTER_STATUS_CHECK
Definition: resource.h:73
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
#define DialogBoxParam
Definition: winuser.h:5776
#define FKF_HOTKEYACTIVE
Definition: winuser.h:2133
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define FKF_CLICKON
Definition: winuser.h:2131
#define BST_CHECKED
Definition: winuser.h:197

Referenced by KeyboardPageProc().

◆ KeyboardPageProc()

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

Definition at line 576 of file keyboard.c.

580{
581 PGLOBAL_DATA pGlobalData;
582 LPPSHNOTIFY lppsn;
583
584 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
585
586 switch (uMsg)
587 {
588 case WM_INITDIALOG:
589 pGlobalData = (PGLOBAL_DATA)((LPPROPSHEETPAGE)lParam)->lParam;
590 if (pGlobalData == NULL)
591 return FALSE;
592
593 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
594
595 CheckDlgButton(hwndDlg,
598
599 CheckDlgButton(hwndDlg,
602
603 CheckDlgButton(hwndDlg,
606
607 CheckDlgButton(hwndDlg,
609 pGlobalData->bKeyboardPref ? BST_CHECKED : BST_UNCHECKED);
610 return TRUE;
611
612 case WM_COMMAND:
613 switch (LOWORD(wParam))
614 {
615 case IDC_STICKY_BOX:
616 pGlobalData->stickyKeys.dwFlags ^= SKF_STICKYKEYSON;
617 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
618 break;
619
623 hwndDlg,
625 (LPARAM)pGlobalData))
626 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
627 break;
628
629 case IDC_FILTER_BOX:
630 pGlobalData->filterKeys.dwFlags ^= FKF_FILTERKEYSON;
631 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
632 break;
633
637 hwndDlg,
639 (LPARAM)pGlobalData))
640 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
641 break;
642
643 case IDC_TOGGLE_BOX:
644 pGlobalData->toggleKeys.dwFlags ^= TKF_TOGGLEKEYSON;
645 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
646 break;
647
651 hwndDlg,
653 (LPARAM)pGlobalData))
654 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
655 break;
656
658 pGlobalData->bKeyboardPref = !pGlobalData->bKeyboardPref;
659 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
660 break;
661
662 default:
663 break;
664 }
665 break;
666
667 case WM_NOTIFY:
668 lppsn = (LPPSHNOTIFY)lParam;
669 if (lppsn->hdr.code == PSN_APPLY)
670 {
672 sizeof(STICKYKEYS),
673 &pGlobalData->stickyKeys,
675
677 sizeof(FILTERKEYS),
678 &pGlobalData->filterKeys,
680
682 sizeof(TOGGLEKEYS),
683 &pGlobalData->toggleKeys,
685
686 SystemParametersInfo(SPI_SETKEYBOARDPREF,
687 pGlobalData->bKeyboardPref,
688 NULL,
690
691 return TRUE;
692 }
693 break;
694 }
695
696 return FALSE;
697}
#define NULL
Definition: types.h:112
INT_PTR CALLBACK StickyKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:68
INT_PTR CALLBACK ToggleKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:524
INT_PTR CALLBACK FilterKeysDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: keyboard.c:404
#define IDC_TOGGLE_BUTTON
Definition: resource.h:39
#define IDC_FILTER_BOX
Definition: resource.h:36
#define IDD_TOGGLEKEYSOPTIONS
Definition: resource.h:16
#define IDD_FILTERKEYSOPTIONS
Definition: resource.h:13
#define IDD_STICKYKEYSOPTIONS
Definition: resource.h:12
#define IDC_TOGGLE_BOX
Definition: resource.h:38
#define IDC_FILTER_BUTTON
Definition: resource.h:37
#define IDC_KEYBOARD_EXTRA
Definition: resource.h:40
#define IDC_STICKY_BOX
Definition: resource.h:34
#define IDC_STICKY_BUTTON
Definition: resource.h:35
#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
STICKYKEYS stickyKeys
Definition: access.h:29
TOGGLEKEYS toggleKeys
Definition: access.h:33
BOOL bKeyboardPref
Definition: access.h:35
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3162
DWORD dwFlags
Definition: winuser.h:3533
DWORD dwFlags
Definition: winuser.h:3538
#define SPI_SETSTICKYKEYS
Definition: winuser.h:1411
#define SKF_STICKYKEYSON
Definition: winuser.h:2182
#define SPIF_SENDCHANGE
Definition: winuser.h:1575
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1574
#define SPI_SETTOGGLEKEYS
Definition: winuser.h:1405
HWND WINAPI GetParent(_In_ HWND)
#define TKF_TOGGLEKEYSON
Definition: winuser.h:2189

Referenced by SystemApplet().

◆ RepeatKeysDlgProc()

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

Definition at line 249 of file keyboard.c.

253{
254 PGLOBAL_DATA pGlobalData;
255 INT i, n;
256
257 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
258
259 switch (uMsg)
260 {
261 case WM_INITDIALOG:
262 pGlobalData = (PGLOBAL_DATA)lParam;
263 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
264
265 CheckRadioButton(hwndDlg,
269
270 /* Initialize the delay combobox */
271 for (n = 0; n < DELAYTICKS; n++)
272 {
273 if (pGlobalData->filterKeys.iDelayMSec < nDelayArray[n])
274 break;
275 }
276 n--;
277
278 for (i = 0; i < DELAYTICKS; i++)
279 {
281 }
282
284
285 /* Initialize the repeat combobox */
286 for (n = 0; n < REPEATTICKS; n++)
287 {
288 if (pGlobalData->filterKeys.iRepeatMSec < nRepeatArray[n])
289 break;
290 }
291 n--;
292
293 for (i = 0; i < REPEATTICKS; i++)
294 {
296 }
297
299
300 /* Disable the delay and repeat comboboxes if needed */
301 if (pGlobalData->filterKeys.iDelayMSec == 0)
302 {
305 }
306
307 /* Initialize the wait combobox */
308 for (n = 0; n < WAITTICKS; n++)
309 {
310 if (pGlobalData->filterKeys.iWaitMSec < nWaitArray[n])
311 break;
312 }
313 n--;
314
315 for (i = 0; i < WAITTICKS; i++)
316 {
318 }
319
321 break;
322
323 case WM_COMMAND:
324 switch (LOWORD(wParam))
325 {
327 pGlobalData->filterKeys.iDelayMSec = 0;
328 pGlobalData->filterKeys.iRepeatMSec = 0;
331 break;
332
336 break;
337
340 {
342 if (i != CB_ERR)
343 {
344 pGlobalData->filterKeys.iDelayMSec = nDelayArray[i];
345 }
346 }
347 break;
348
351 {
353 if (i != CB_ERR)
354 {
355 pGlobalData->filterKeys.iRepeatMSec = nRepeatArray[i];
356 }
357 }
358 break;
359
362 {
364 if (i != CB_ERR)
365 {
366 pGlobalData->filterKeys.iWaitMSec = nWaitArray[i];
367 }
368 }
369 break;
370
372 switch (HIWORD(wParam))
373 {
374 case EN_SETFOCUS:
375 EnableFilterKeysTest(pGlobalData);
376 break;
377
378 case EN_KILLFOCUS:
379 DisableFilterKeysTest(pGlobalData);
380 break;
381 }
382 break;
383
384 case IDOK:
385 EndDialog(hwndDlg, TRUE);
386 break;
387
388 case IDCANCEL:
389 EndDialog(hwndDlg, FALSE);
390 break;
391
392 default:
393 break;
394 }
395 break;
396 }
397
398 return FALSE;
399}
#define WAITTICKS
Definition: keyboard.c:21
static UINT nWaitArray[WAITTICKS]
Definition: keyboard.c:22
static UINT nDelayArray[DELAYTICKS]
Definition: keyboard.c:16
static UINT nRepeatArray[REPEATTICKS]
Definition: keyboard.c:19
#define REPEATTICKS
Definition: keyboard.c:18
#define DELAYTICKS
Definition: keyboard.c:15
#define IDC_REPEAT_REPEAT_COMBO
Definition: resource.h:81
#define IDC_REPEAT_TEST_EDIT
Definition: resource.h:83
#define IDC_REPEAT_DELAY_COMBO
Definition: resource.h:80
#define IDC_REPEAT_WAIT_COMBO
Definition: resource.h:82
#define IDC_REPEAT_REPEAT_RADIO
Definition: resource.h:79
#define IDC_REPEAT_NOREPEAT_RADIO
Definition: resource.h:78
DWORD iRepeatMSec
Definition: winuser.h:3362
DWORD iWaitMSec
Definition: winuser.h:3360
DWORD iDelayMSec
Definition: winuser.h:3361

Referenced by FilterKeysDlgProc().

◆ StickyKeysDlgProc()

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

Definition at line 68 of file keyboard.c.

72{
73 PGLOBAL_DATA pGlobalData;
74
75 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
76
77 switch (uMsg)
78 {
79 case WM_INITDIALOG:
80 pGlobalData = (PGLOBAL_DATA)lParam;
81 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
82
83 memcpy(&pGlobalData->oldStickyKeys,
84 &pGlobalData->stickyKeys,
85 sizeof(STICKYKEYS));
86
87 CheckDlgButton(hwndDlg,
90
91 CheckDlgButton(hwndDlg,
94
95 CheckDlgButton(hwndDlg,
98
99 CheckDlgButton(hwndDlg,
102
103 CheckDlgButton(hwndDlg,
106 break;
107
108 case WM_COMMAND:
109 switch (LOWORD(wParam))
110 {
112 pGlobalData->stickyKeys.dwFlags ^= SKF_HOTKEYACTIVE;
113 break;
114
116 pGlobalData->stickyKeys.dwFlags ^= SKF_TRISTATE;
117 break;
118
120 pGlobalData->stickyKeys.dwFlags ^= SKF_TWOKEYSOFF;
121 break;
122
124 pGlobalData->stickyKeys.dwFlags ^= SKF_AUDIBLEFEEDBACK;
125 break;
126
128 pGlobalData->stickyKeys.dwFlags ^= SKF_INDICATOR;
129 break;
130
131 case IDOK:
132 EndDialog(hwndDlg,
133 (pGlobalData->stickyKeys.dwFlags != pGlobalData->oldStickyKeys.dwFlags));
134 break;
135
136 case IDCANCEL:
137 EndDialog(hwndDlg, FALSE);
138 break;
139
140 default:
141 break;
142 }
143 break;
144 }
145
146 return FALSE;
147}
#define IDC_STICKY_SOUND_CHECK
Definition: resource.h:63
#define IDC_STICKY_UNLOCK_CHECK
Definition: resource.h:62
#define IDC_STICKY_STATUS_CHECK
Definition: resource.h:64
#define IDC_STICKY_ACTIVATE_CHECK
Definition: resource.h:60
#define IDC_STICKY_LOCK_CHECK
Definition: resource.h:61
STICKYKEYS oldStickyKeys
Definition: access.h:30
#define SKF_HOTKEYACTIVE
Definition: winuser.h:2179
#define SKF_AUDIBLEFEEDBACK
Definition: winuser.h:2176
#define SKF_INDICATOR
Definition: winuser.h:2181
#define SKF_TWOKEYSOFF
Definition: winuser.h:2184
#define SKF_TRISTATE
Definition: winuser.h:2183

Referenced by KeyboardPageProc().

◆ ToggleKeysDlgProc()

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

Definition at line 524 of file keyboard.c.

528{
529 PGLOBAL_DATA pGlobalData;
530
531 pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
532
533 switch (uMsg)
534 {
535 case WM_INITDIALOG:
536 pGlobalData = (PGLOBAL_DATA)lParam;
537 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
538
539 memcpy(&pGlobalData->oldToggleKeys,
540 &pGlobalData->toggleKeys,
541 sizeof(TOGGLEKEYS));
542
543 CheckDlgButton(hwndDlg,
546 break;
547
548 case WM_COMMAND:
549 switch (LOWORD(wParam))
550 {
552 pGlobalData->toggleKeys.dwFlags ^= TKF_HOTKEYACTIVE;
553 break;
554
555 case IDOK:
556 EndDialog(hwndDlg,
557 (pGlobalData->toggleKeys.dwFlags != pGlobalData->oldToggleKeys.dwFlags));
558 break;
559
560 case IDCANCEL:
561 EndDialog(hwndDlg, FALSE);
562 break;
563
564 default:
565 break;
566 }
567 break;
568 }
569
570 return FALSE;
571}
#define IDC_TOGGLE_ACTIVATE_CHECK
Definition: resource.h:85
TOGGLEKEYS oldToggleKeys
Definition: access.h:34
#define TKF_HOTKEYACTIVE
Definition: winuser.h:2187

Referenced by KeyboardPageProc().

Variable Documentation

◆ nBounceArray

UINT nBounceArray[BOUNCETICKS] = {500, 700, 1000, 1500, 2000}
static

Definition at line 13 of file keyboard.c.

Referenced by BounceKeysDlgProc().

◆ nDelayArray

UINT nDelayArray[DELAYTICKS] = {300, 700, 1000, 1500, 2000}
static

Definition at line 16 of file keyboard.c.

Referenced by RepeatKeysDlgProc().

◆ nRepeatArray

UINT nRepeatArray[REPEATTICKS] = {300, 500, 700, 1000, 1500, 2000}
static

Definition at line 19 of file keyboard.c.

Referenced by RepeatKeysDlgProc().

◆ nWaitArray

UINT nWaitArray[WAITTICKS] = {0, 300, 500, 700, 1000, 1500, 2000, 5000, 10000, 20000}
static

Definition at line 22 of file keyboard.c.

Referenced by RepeatKeysDlgProc().