- 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
This commit is contained in:
Dmitry Chapyshev 2016-08-10 19:04:11 +00:00
parent 22c0bb2723
commit 4245233f5f
3 changed files with 34 additions and 20 deletions

View file

@ -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);

View file

@ -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;
}

View file

@ -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
{