Skip to content

Commit e45b51c

Browse files
committedJul 11, 2019
Add Keyboard Input Grouping status item
1 parent e241b7e commit e45b51c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
 

‎src/ConEmu/Status.cpp

100644100755
+17
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ static StatusColInfo gStatusCols[] =
108108
L"Scroll Lock state",
109109
L"Scroll Lock state, left click to change"},
110110

111+
{csi_InputGrouping, L"StatusBar.Hide.InputGrouping",
112+
L"Input Grouping state",
113+
L"Input Grouping state"},
114+
111115
{csi_KeyHooks, L"StatusBar.Hide.KeyHooks",
112116
L"Keyboard hooks",
113117
L"Install keyboard hooks status"},
@@ -651,6 +655,10 @@ void CStatus::PaintStatus(HDC hPaint, LPRECT prcStatus /*= NULL*/)
651655
wcscpy_c(m_Items[nDrawCount].sText, m_Values[csi_ViewLock].sText);
652656
wcscpy_c(m_Items[nDrawCount].szFormat, m_Values[csi_ViewLock].szFormat);
653657
break;
658+
case csi_InputGrouping:
659+
wcscpy_c(m_Items[nDrawCount].sText, L"InpGrp");
660+
wcscpy_c(m_Items[nDrawCount].szFormat, L"InpGrp");
661+
break;
654662
case csi_InputLocale:
655663
// чтобы не задавали вопросов, нафига дублируется.
656664
if (LOWORD((DWORD)mhk_Locale) == HIWORD((DWORD)mhk_Locale))
@@ -908,6 +916,9 @@ void CStatus::PaintStatus(HDC hPaint, LPRECT prcStatus /*= NULL*/)
908916
case csi_ViewLock:
909917
SetTextColor(hDrawDC, mb_ViewLock ? crText : crDash);
910918
break;
919+
case csi_InputGrouping:
920+
SetTextColor(hDrawDC, mb_InputGrouping ? crText : crDash);
921+
break;
911922
case csi_KeyHooks:
912923
SetTextColor(hDrawDC, mb_KeyHooks ? crText : crDash);
913924
break;
@@ -1959,6 +1970,7 @@ bool CStatus::IsKeyboardChanged()
19591970
bool bNum = ((states[1] = GetKeyState(VK_NUMLOCK)) & 1) == 1;
19601971
bool bScroll = ((states[2] = GetKeyState(VK_SCROLL)) & 1) == 1;
19611972
bool bKeyHooks = gpConEmu->IsKeyboardHookRegistered();
1973+
bool bGrouping = gpConEmu->isInputGrouped();
19621974
DWORD_PTR hkl = gpConEmu->GetActiveKeyboardLayout();
19631975

19641976
if (bCaps != mb_Caps)
@@ -1981,6 +1993,11 @@ bool CStatus::IsKeyboardChanged()
19811993
mb_KeyHooks = bKeyHooks; bChanged = true;
19821994
}
19831995

1996+
if (bGrouping != mb_InputGrouping)
1997+
{
1998+
mb_InputGrouping = bGrouping; bChanged = true;
1999+
}
2000+
19842001
if (hkl != mhk_Locale)
19852002
{
19862003
mhk_Locale = hkl; bChanged = true;

‎src/ConEmu/Status.h

100644100755
+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ enum CEStatusItems
4949
csi_NumLock,
5050
csi_ScrollLock,
5151
csi_ViewLock,
52+
csi_InputGrouping,
5253
csi_InputLocale,
5354
csi_KeyHooks,
5455
csi_TermModes,
@@ -174,6 +175,7 @@ class CStatus
174175
bool LoadActiveProcess(CRealConsole* pRCon, wchar_t* pszText, int cchMax);
175176

176177
bool mb_Caps, mb_Num, mb_Scroll;
178+
bool mb_InputGrouping;
177179
bool mb_KeyHooks;
178180
DWORD_PTR mhk_Locale; // CConEmuMain::GetActiveKeyboardLayout()
179181
bool IsKeyboardChanged();

0 commit comments

Comments
 (0)