mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 05:20:54 +00:00
- Add missing keyboard speed dialog resources.
- Implement keyboard repeat delay and repeat rate settings. svn path=/trunk/; revision=26280
This commit is contained in:
parent
d3bc04a87c
commit
a580611fe7
6 changed files with 225 additions and 37 deletions
|
@ -7,7 +7,23 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
|||
CAPTION "Geschwindigkeit"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Tastaturgeschwindigkeit",-1,73,74,130,8
|
||||
GROUPBOX "Zeichenwiederholung", -1, 5, 5, 230, 130
|
||||
ICON -1, IDC_ICON_REPEAT_DELAY, 15, 15, 15, 15
|
||||
LTEXT "&Verzögerung:", -1, 40, 15, 50, 10
|
||||
LTEXT "Lang", -1, 40, 30, 24, 10
|
||||
LTEXT "Kurz", -1, 200, 30, 24, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
|
||||
ICON -1, IDC_ICON_REPEAT_RATE, 15, 70, 15, 15
|
||||
LTEXT "&Wiederholrate:", -1, 40, 70, 50, 10
|
||||
LTEXT "Niedrig", -1, 40, 85, 24, 10
|
||||
LTEXT "Hoch", -1, 200, 85, 24, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
|
||||
LTEXT "&Klicken Sie hier, und drücken Sie zum Testen eine Taste:", -1, 15, 105, 180, 10
|
||||
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
|
||||
GROUPBOX "&Cursorblinkgeschwindgkeit", -1, 5, 145, 230, 50
|
||||
LTEXT "Langsam", -1, 35, 165, 33, 10
|
||||
LTEXT "Schnell", -1, 200, 165, 33, 10
|
||||
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
|
||||
END
|
||||
|
||||
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
|
||||
|
|
|
@ -5,7 +5,23 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
|||
CAPTION "Velocidad"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Velocidad del teclado",-1,73,74,90,8
|
||||
GROUPBOX "Character repeat", -1, 5, 5, 230, 130
|
||||
ICON -1, IDC_ICON_REPEAT_DELAY, 15, 15, 15, 15
|
||||
LTEXT "Repeat &delay", -1, 40, 15, 50, 10
|
||||
LTEXT "Long", -1, 40, 30, 20, 10
|
||||
LTEXT "Short", -1, 200, 30, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
|
||||
ICON -1, IDC_ICON_REPEAT_RATE, 15, 70, 15, 15
|
||||
LTEXT "&Repeat rate", -1, 40, 70, 50, 10
|
||||
LTEXT "Slow", -1, 40, 85, 20, 10
|
||||
LTEXT "Fast", -1, 200, 85, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
|
||||
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15, 105, 150, 10
|
||||
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
|
||||
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
|
||||
LTEXT "None", -1, 40, 165, 30, 10
|
||||
LTEXT "Fast", -1, 200, 165, 30, 10
|
||||
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
|
||||
END
|
||||
|
||||
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
|
||||
|
|
|
@ -5,7 +5,23 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
|||
CAPTION "Érzékenység"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Billentyűzet beállítások",-1,73,74,90,8
|
||||
GROUPBOX "Character repeat", -1, 5, 5, 230, 130
|
||||
ICON -1, IDC_ICON_REPEAT_DELAY, 15, 15, 15, 15
|
||||
LTEXT "Repeat &delay", -1, 40, 15, 50, 10
|
||||
LTEXT "Long", -1, 40, 30, 20, 10
|
||||
LTEXT "Short", -1, 200, 30, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
|
||||
ICON -1, IDC_ICON_REPEAT_RATE, 15, 70, 15, 15
|
||||
LTEXT "&Repeat rate", -1, 40, 70, 50, 10
|
||||
LTEXT "Slow", -1, 40, 85, 20, 10
|
||||
LTEXT "Fast", -1, 200, 85, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
|
||||
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15, 105, 150, 10
|
||||
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
|
||||
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
|
||||
LTEXT "None", -1, 40, 165, 30, 10
|
||||
LTEXT "Fast", -1, 200, 165, 30, 10
|
||||
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
|
||||
END
|
||||
|
||||
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
|
||||
|
|
|
@ -5,7 +5,23 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
|||
CAPTION "Speed"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Keyboard Speed Page",-1,73,74,90,8
|
||||
GROUPBOX "Character repeat", -1, 5, 5, 230, 130
|
||||
ICON -1, IDC_ICON_REPEAT_DELAY, 15, 15, 15, 15
|
||||
LTEXT "Repeat &delay", -1, 40, 15, 50, 10
|
||||
LTEXT "Long", -1, 40, 30, 20, 10
|
||||
LTEXT "Short", -1, 200, 30, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
|
||||
ICON -1, IDC_ICON_REPEAT_RATE, 15, 70, 15, 15
|
||||
LTEXT "&Repeat rate", -1, 40, 70, 50, 10
|
||||
LTEXT "Slow", -1, 40, 85, 20, 10
|
||||
LTEXT "Fast", -1, 200, 85, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
|
||||
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15, 105, 150, 10
|
||||
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
|
||||
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
|
||||
LTEXT "None", -1, 40, 165, 30, 10
|
||||
LTEXT "Fast", -1, 200, 165, 30, 10
|
||||
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
|
||||
END
|
||||
|
||||
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
|
||||
|
|
|
@ -4,7 +4,23 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
|
|||
CAPTION "Speed"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Keyboard Speed Page",-1,73,74,90,8
|
||||
GROUPBOX "Character repeat", -1, 5, 5, 230, 130
|
||||
ICON -1, IDC_ICON_REPEAT_DELAY, 15, 15, 15, 15
|
||||
LTEXT "Repeat &delay", -1, 40, 15, 50, 10
|
||||
LTEXT "Long", -1, 40, 30, 20, 10
|
||||
LTEXT "Short", -1, 200, 30, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_DELAY, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 30, 130, 17
|
||||
ICON -1, IDC_ICON_REPEAT_RATE, 15, 70, 15, 15
|
||||
LTEXT "&Repeat rate", -1, 40, 70, 50, 10
|
||||
LTEXT "Slow", -1, 40, 85, 20, 10
|
||||
LTEXT "Fast", -1, 200, 85, 20, 10
|
||||
CONTROL "",IDC_SLIDER_REPEAT_RATE, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 85, 130, 17
|
||||
LTEXT "Click here and hold down a key to &test repeat rate:", -1, 15, 105, 150, 10
|
||||
EDITTEXT IDC_EDIT_REPEAT_RATE, 15, 115, 200, 15, WS_CHILD | WS_VISIBLE | WS_GROUP
|
||||
GROUPBOX "Cursor &blink rate:", -1, 5, 145, 230, 50
|
||||
LTEXT "None", -1, 40, 165, 30, 10
|
||||
LTEXT "Fast", -1, 200, 165, 30, 10
|
||||
CONTROL "",IDC_SLIDER_CURSOR_BLINK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 165, 130, 17
|
||||
END
|
||||
|
||||
IDD_HARDWARE DIALOGEX 0, 0, 246, 228
|
||||
|
|
|
@ -33,20 +33,128 @@
|
|||
#include "main.h"
|
||||
#include "resource.h"
|
||||
|
||||
typedef struct _SPEED_DATA
|
||||
{
|
||||
INT nKeyboardDelay;
|
||||
DWORD dwKeyboardSpeed;
|
||||
|
||||
} SPEED_DATA, *PSPEED_DATA;
|
||||
|
||||
|
||||
/* Property page dialog callback */
|
||||
static INT_PTR CALLBACK
|
||||
KeybSpeedProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
KeyboardSpeedProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
switch(uMsg)
|
||||
PSPEED_DATA pSpeedData;
|
||||
|
||||
pSpeedData = (PSPEED_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
pSpeedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SPEED_DATA));
|
||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSpeedData);
|
||||
|
||||
/* Get current keyboard delay */
|
||||
if (!SystemParametersInfo(SPI_GETKEYBOARDDELAY,
|
||||
sizeof(INT),
|
||||
&pSpeedData->nKeyboardDelay,
|
||||
0))
|
||||
{
|
||||
pSpeedData->nKeyboardDelay = 2;
|
||||
}
|
||||
|
||||
/* Get current keyboard delay */
|
||||
if (!SystemParametersInfo(SPI_GETKEYBOARDSPEED,
|
||||
sizeof(DWORD),
|
||||
&pSpeedData->dwKeyboardSpeed,
|
||||
0))
|
||||
{
|
||||
pSpeedData->dwKeyboardSpeed = 31;
|
||||
}
|
||||
|
||||
SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_DELAY, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 3));
|
||||
SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_DELAY, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(3 - pSpeedData->nKeyboardDelay));
|
||||
|
||||
SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_RATE, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 31));
|
||||
SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_RATE, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pSpeedData->dwKeyboardSpeed);
|
||||
|
||||
break;
|
||||
|
||||
case WM_HSCROLL:
|
||||
if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SLIDER_REPEAT_DELAY))
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case TB_LINEUP:
|
||||
case TB_LINEDOWN:
|
||||
case TB_PAGEUP:
|
||||
case TB_PAGEDOWN:
|
||||
case TB_TOP:
|
||||
case TB_BOTTOM:
|
||||
case TB_ENDTRACK:
|
||||
pSpeedData->nKeyboardDelay = 3 - (INT)SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_DELAY, TBM_GETPOS, 0, 0);
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
break;
|
||||
|
||||
case TB_THUMBTRACK:
|
||||
pSpeedData->nKeyboardDelay = 3 - (INT)HIWORD(wParam);
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SLIDER_REPEAT_RATE))
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case TB_LINEUP:
|
||||
case TB_LINEDOWN:
|
||||
case TB_PAGEUP:
|
||||
case TB_PAGEDOWN:
|
||||
case TB_TOP:
|
||||
case TB_BOTTOM:
|
||||
case TB_ENDTRACK:
|
||||
pSpeedData->dwKeyboardSpeed = (DWORD)SendDlgItemMessage(hwndDlg, IDC_SLIDER_REPEAT_RATE, TBM_GETPOS, 0, 0);
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
break;
|
||||
|
||||
case TB_THUMBTRACK:
|
||||
pSpeedData->dwKeyboardSpeed = (DWORD)HIWORD(wParam);
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR lpnm = (LPNMHDR)lParam;
|
||||
|
||||
switch(lpnm->code)
|
||||
{
|
||||
case PSN_APPLY:
|
||||
SystemParametersInfo(SPI_SETKEYBOARDDELAY,
|
||||
pSpeedData->nKeyboardDelay,
|
||||
0,
|
||||
0);
|
||||
SystemParametersInfo(SPI_SETKEYBOARDSPEED,
|
||||
pSpeedData->dwKeyboardSpeed,
|
||||
0,
|
||||
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
HeapFree(GetProcessHeap(), 0, pSpeedData);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -57,9 +165,9 @@ KeybSpeedProc(IN HWND hwndDlg,
|
|||
/* Property page dialog callback */
|
||||
static INT_PTR CALLBACK
|
||||
KeybHardwareProc(IN HWND hwndDlg,
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
IN UINT uMsg,
|
||||
IN WPARAM wParam,
|
||||
IN LPARAM lParam)
|
||||
{
|
||||
GUID Guids[1];
|
||||
Guids[0] = GUID_DEVCLASS_KEYBOARD;
|
||||
|
@ -89,32 +197,32 @@ KeybHardwareProc(IN HWND hwndDlg,
|
|||
LONG APIENTRY
|
||||
KeyboardApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
|
||||
{
|
||||
PROPSHEETPAGE psp[2];
|
||||
PROPSHEETHEADER psh;
|
||||
TCHAR Caption[256];
|
||||
PROPSHEETPAGE psp[2];
|
||||
PROPSHEETHEADER psh;
|
||||
TCHAR szCaption[256];
|
||||
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(uMsg);
|
||||
UNREFERENCED_PARAMETER(hwnd);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(uMsg);
|
||||
UNREFERENCED_PARAMETER(hwnd);
|
||||
|
||||
LoadString(hApplet, IDS_CPLNAME_2, Caption, sizeof(Caption) / sizeof(TCHAR));
|
||||
LoadString(hApplet, IDS_CPLNAME_2, szCaption, sizeof(szCaption) / sizeof(TCHAR));
|
||||
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
||||
psh.hwndParent = NULL;
|
||||
psh.hInstance = hApplet;
|
||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_2));
|
||||
psh.pszCaption = Caption;
|
||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||
psh.nStartPage = 0;
|
||||
psh.ppsp = psp;
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
||||
psh.hwndParent = NULL;
|
||||
psh.hInstance = hApplet;
|
||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_2));
|
||||
psh.pszCaption = szCaption;
|
||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||
psh.nStartPage = 0;
|
||||
psh.ppsp = psp;
|
||||
|
||||
InitPropSheetPage(&psp[0], IDD_KEYBSPEED, KeybSpeedProc);
|
||||
InitPropSheetPage(&psp[1], IDD_HARDWARE, KeybHardwareProc);
|
||||
InitPropSheetPage(&psp[0], IDD_KEYBSPEED, KeyboardSpeedProc);
|
||||
InitPropSheetPage(&psp[1], IDD_HARDWARE, KeybHardwareProc);
|
||||
|
||||
return (LONG)(PropertySheet(&psh) != -1);
|
||||
return (LONG)(PropertySheet(&psh) != -1);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue