From e45b51caa32e3558188a4107687e986169bf7919 Mon Sep 17 00:00:00 2001 From: Terry Katz Date: Thu, 11 Jul 2019 12:38:12 -0400 Subject: [PATCH] Add Keyboard Input Grouping status item --- src/ConEmu/Status.cpp | 17 +++++++++++++++++ src/ConEmu/Status.h | 2 ++ 2 files changed, 19 insertions(+) mode change 100644 => 100755 src/ConEmu/Status.cpp mode change 100644 => 100755 src/ConEmu/Status.h diff --git a/src/ConEmu/Status.cpp b/src/ConEmu/Status.cpp old mode 100644 new mode 100755 index 07f74d80c7..e3dc84ec18 --- a/src/ConEmu/Status.cpp +++ b/src/ConEmu/Status.cpp @@ -108,6 +108,10 @@ static StatusColInfo gStatusCols[] = L"Scroll Lock state", L"Scroll Lock state, left click to change"}, + {csi_InputGrouping, L"StatusBar.Hide.InputGrouping", + L"Input Grouping state", + L"Input Grouping state"}, + {csi_KeyHooks, L"StatusBar.Hide.KeyHooks", L"Keyboard hooks", L"Install keyboard hooks status"}, @@ -651,6 +655,10 @@ void CStatus::PaintStatus(HDC hPaint, LPRECT prcStatus /*= NULL*/) wcscpy_c(m_Items[nDrawCount].sText, m_Values[csi_ViewLock].sText); wcscpy_c(m_Items[nDrawCount].szFormat, m_Values[csi_ViewLock].szFormat); break; + case csi_InputGrouping: + wcscpy_c(m_Items[nDrawCount].sText, L"InpGrp"); + wcscpy_c(m_Items[nDrawCount].szFormat, L"InpGrp"); + break; case csi_InputLocale: // чтобы не задавали вопросов, нафига дублируется. if (LOWORD((DWORD)mhk_Locale) == HIWORD((DWORD)mhk_Locale)) @@ -908,6 +916,9 @@ void CStatus::PaintStatus(HDC hPaint, LPRECT prcStatus /*= NULL*/) case csi_ViewLock: SetTextColor(hDrawDC, mb_ViewLock ? crText : crDash); break; + case csi_InputGrouping: + SetTextColor(hDrawDC, mb_InputGrouping ? crText : crDash); + break; case csi_KeyHooks: SetTextColor(hDrawDC, mb_KeyHooks ? crText : crDash); break; @@ -1959,6 +1970,7 @@ bool CStatus::IsKeyboardChanged() bool bNum = ((states[1] = GetKeyState(VK_NUMLOCK)) & 1) == 1; bool bScroll = ((states[2] = GetKeyState(VK_SCROLL)) & 1) == 1; bool bKeyHooks = gpConEmu->IsKeyboardHookRegistered(); + bool bGrouping = gpConEmu->isInputGrouped(); DWORD_PTR hkl = gpConEmu->GetActiveKeyboardLayout(); if (bCaps != mb_Caps) @@ -1981,6 +1993,11 @@ bool CStatus::IsKeyboardChanged() mb_KeyHooks = bKeyHooks; bChanged = true; } + if (bGrouping != mb_InputGrouping) + { + mb_InputGrouping = bGrouping; bChanged = true; + } + if (hkl != mhk_Locale) { mhk_Locale = hkl; bChanged = true; diff --git a/src/ConEmu/Status.h b/src/ConEmu/Status.h old mode 100644 new mode 100755 index d827e9e30c..e4afe492a2 --- a/src/ConEmu/Status.h +++ b/src/ConEmu/Status.h @@ -49,6 +49,7 @@ enum CEStatusItems csi_NumLock, csi_ScrollLock, csi_ViewLock, + csi_InputGrouping, csi_InputLocale, csi_KeyHooks, csi_TermModes, @@ -174,6 +175,7 @@ class CStatus bool LoadActiveProcess(CRealConsole* pRCon, wchar_t* pszText, int cchMax); bool mb_Caps, mb_Num, mb_Scroll; + bool mb_InputGrouping; bool mb_KeyHooks; DWORD_PTR mhk_Locale; // CConEmuMain::GetActiveKeyboardLayout() bool IsKeyboardChanged();