From 4245233f5f3bd2c5863dd78c64db5a3bb49a5098 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Wed, 10 Aug 2016 19:04:11 +0000 Subject: [PATCH] [INPUT] - Draw 0x2022 unicode symbol instead 0x25CF (marking default input method) - Fix incorrect logic in CapsLock parameters - Notice system of change CapsLock mode parameters svn path=/trunk/; revision=72189 --- reactos/dll/cpl/input/input.h | 3 ++ reactos/dll/cpl/input/key_settings_dialog.c | 49 +++++++++++++-------- reactos/dll/cpl/input/settings_page.c | 2 +- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/reactos/dll/cpl/input/input.h b/reactos/dll/cpl/input/input.h index f3160c63107..bf2d06df14b 100644 --- a/reactos/dll/cpl/input/input.h +++ b/reactos/dll/cpl/input/input.h @@ -67,6 +67,9 @@ typedef struct INT_PTR CALLBACK KeySettingsDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +DWORD +ReadAttributes(VOID); + /* key_sequence_dialog.c */ INT_PTR CALLBACK ChangeKeySeqDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); diff --git a/reactos/dll/cpl/input/key_settings_dialog.c b/reactos/dll/cpl/input/key_settings_dialog.c index 536c6f9f8b1..d62d97c90a8 100644 --- a/reactos/dll/cpl/input/key_settings_dialog.c +++ b/reactos/dll/cpl/input/key_settings_dialog.c @@ -10,9 +10,10 @@ static KEY_SETTINGS _KeySettings = { 0 }; -static VOID -ReadKeysSettings(VOID) +DWORD +ReadAttributes(VOID) { + DWORD dwAttributes = 0; HKEY hKey; if (RegOpenKeyExW(HKEY_CURRENT_USER, @@ -25,18 +26,25 @@ ReadKeysSettings(VOID) dwSize = sizeof(dwSize); - if (RegQueryValueExW(hKey, - L"Attributes", - NULL, NULL, - (LPBYTE)&_KeySettings.dwAttributes, - &dwSize) != ERROR_SUCCESS) - { - _KeySettings.dwAttributes = (DWORD) -1; - } + RegQueryValueExW(hKey, + L"Attributes", + NULL, NULL, + (LPBYTE)&dwAttributes, + &dwSize); RegCloseKey(hKey); } + return dwAttributes; +} + +static VOID +ReadKeysSettings(VOID) +{ + HKEY hKey; + + _KeySettings.dwAttributes = ReadAttributes(); + if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Keyboard Layout\\Toggle", 0, @@ -126,10 +134,13 @@ WriteKeysSettings(VOID) (wcslen(szBuffer) + 1) * sizeof(WCHAR)); RegCloseKey(hKey); - - /* Notice system of change of parameters */ - SystemParametersInfoW(SPI_SETLANGTOGGLE, 0, NULL, 0); } + + /* Notice system of change hotkeys parameters */ + SystemParametersInfoW(SPI_SETLANGTOGGLE, 0, NULL, 0); + + /* Notice system of change CapsLock mode parameters */ + ActivateKeyboardLayout(GetKeyboardLayout(0), KLF_RESET | _KeySettings.dwAttributes); } @@ -178,20 +189,20 @@ OnInitKeySettingsDialog(HWND hwndDlg) if (_KeySettings.dwAttributes & KLF_SHIFTLOCK) { - CheckDlgButton(hwndDlg, IDC_PRESS_SHIFT_KEY_RB, BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_PRESS_CL_KEY_RB, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_PRESS_SHIFT_KEY_RB, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_PRESS_CL_KEY_RB, BST_UNCHECKED); } else { - CheckDlgButton(hwndDlg, IDC_PRESS_SHIFT_KEY_RB, BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_PRESS_CL_KEY_RB, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PRESS_SHIFT_KEY_RB, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PRESS_CL_KEY_RB, BST_CHECKED); } hwndList = GetDlgItem(hwndDlg, IDC_KEY_LISTVIEW); ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT); - ZeroMemory(&column, sizeof(column)); + ZeroMemory(&column, sizeof(column)); column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; @@ -243,7 +254,7 @@ KeySettingsDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDOK: { - if (IsDlgButtonChecked(hwndDlg, IDC_PRESS_CL_KEY_RB) == BST_UNCHECKED) + if (IsDlgButtonChecked(hwndDlg, IDC_PRESS_CL_KEY_RB) == BST_CHECKED) { _KeySettings.dwAttributes &= ~KLF_SHIFTLOCK; } diff --git a/reactos/dll/cpl/input/settings_page.c b/reactos/dll/cpl/input/settings_page.c index 38d1f280dfb..0404b63c45c 100644 --- a/reactos/dll/cpl/input/settings_page.c +++ b/reactos/dll/cpl/input/settings_page.c @@ -63,7 +63,7 @@ CreateLayoutIcon(LPWSTR szLayout, BOOL bIsDefault) ExtTextOutW(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, L"", 0, NULL); SelectObject(hdc, hFont); - DrawTextW(hdc, L"\x25CF", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); + DrawTextW(hdc, L"\x2022", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); } else {