Skip to content

Commit

Permalink
Add Keyboard Input Grouping status item
Browse files Browse the repository at this point in the history
  • Loading branch information
tkatz77 committed Jul 11, 2019
1 parent e241b7e commit e45b51c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ConEmu/Status.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/ConEmu/Status.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ enum CEStatusItems
csi_NumLock,
csi_ScrollLock,
csi_ViewLock,
csi_InputGrouping,
csi_InputLocale,
csi_KeyHooks,
csi_TermModes,
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e45b51c

Please sign in to comment.