Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added switch term mode hotkey #2545

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/ConEmu/ConEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2610,6 +2610,18 @@ CConEmuMain::~CConEmuMain()
}
#endif

void CConEmuMain::AskChangeTermMode()
{
CVConGuard VCon;
if (GetActiveVCon(&VCon) < 0)
return;
CVirtualConsole *pVCon = VCon.VCon();
CRealConsole *pRCon = pVCon->RCon();
if (!pRCon) return;

pRCon ->StartStopTermMode(tmc_TerminalType, cta_Switch);
}

void CConEmuMain::AskChangeBufferHeight()
{
CVConGuard VCon;
Expand Down
1 change: 1 addition & 0 deletions src/ConEmu/ConEmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ class CConEmuMain
int ActiveConNum(); // 0-based
int GetConCount(); // количество открытых консолей
void AskChangeBufferHeight();
void AskChangeTermMode();
void AskChangeAlternative();
void AttachToDialog();
void CheckFocus(LPCWSTR asFrom);
Expand Down
8 changes: 8 additions & 0 deletions src/ConEmu/ConEmuCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@ bool CConEmuCtrl::key_MultiBuffer(const ConEmuChord& VkState, bool TestOnly, con
return true;
}

// pRCon may be nullptr
bool CConEmuCtrl::key_SwitchTermMode(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon)
{
if (TestOnly)
return true;
gpConEmu->AskChangeTermMode();
return true;
}
// pRCon may be nullptr
bool CConEmuCtrl::key_DuplicateRoot(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon)
{
Expand Down
1 change: 1 addition & 0 deletions src/ConEmu/ConEmuCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class CConEmuCtrl
static bool WINAPI key_MultiRecreate(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
static bool WINAPI key_AlternativeBuffer(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
static bool WINAPI key_MultiBuffer(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
static bool WINAPI key_SwitchTermMode(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
static bool WINAPI key_DuplicateRoot(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
static bool WINAPI key_DuplicateRootAs(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
static bool WINAPI key_MultiCmd(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon);
Expand Down
2 changes: 2 additions & 0 deletions src/ConEmu/HotkeyList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ int ConEmuHotKeyList::AllocateHotkeys()
.SetHotKey(VK_PAUSE);
Add(vkMultiBuffer, chk_User, L"Multi.Scroll", CConEmuCtrl::key_MultiBuffer)
;
Add(vkSwitchTermMode, chk_User, L"Multi.SwitchTermMode", CConEmuCtrl::key_SwitchTermMode)
.SetHotKey('M',VK_CONTROL,VK_SHIFT);
Add(vkMultiGroup, chk_User, L"Multi.GroupInput" ).SetMacro(L"GroupInput(0)")
.SetHotKey('G', VK_APPS);
Add(vkMultiGroupAll, chk_User, L"Multi.GroupInputAll" ).SetMacro(L"GroupInput(3)")
Expand Down
1 change: 1 addition & 0 deletions src/ConEmu/LngDataHints.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ static LngPredefined gsDataHints[] = {
{ vkMoveTabRight, L"Move active tab rightward" },
{ vkMultiAltCon, L"Show alternative console buffer (last command output)" },
{ vkMultiBuffer, L"Switch bufferheight mode" },
{ vkSwitchTermMode, L"Switch Terminal Input Mode" },
{ vkMultiClose, L"Close active console" },
{ vkMultiCmd, L"Create new %s console" },
{ vkMultiGroup, L"Group keyboard input for visible splits" },
Expand Down
1 change: 1 addition & 0 deletions src/ConEmu/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,7 @@
#define stStartupShellGeneral 3110
#define tFarHourglass 3111
#define vkSetFocusParent 3212
#define vkSwitchTermMode 3220
#define IDC_STATIC -1

// Next default values for new objects
Expand Down