コード例 #1
0
ファイル: manager.cpp プロジェクト: Firebie/FarManager
static int CASHook(const Manager::Key& key)
{
	if (key.IsEvent())
	{
		const KEY_EVENT_RECORD& rec=key.Event().Event.KeyEvent;
		if (rec.bKeyDown)
		{
			switch (rec.wVirtualKeyCode)
			{
				case VK_SHIFT:
				case VK_MENU:
				case VK_CONTROL:
				{
					const auto
						maskLeft=LEFT_CTRL_PRESSED|LEFT_ALT_PRESSED|SHIFT_PRESSED,
						maskRight=RIGHT_CTRL_PRESSED|RIGHT_ALT_PRESSED|SHIFT_PRESSED;
					auto state=rec.dwControlKeyState;
					auto wait=[](DWORD mask)
					{
						for (;;)
						{
							INPUT_RECORD rec;

							if (PeekInputRecord(&rec,true))
							{
								GetInputRecord(&rec,true,true);
								if ((rec.Event.KeyEvent.dwControlKeyState&mask) != mask)
									break;
							}

							Sleep(1);
						}
					};
					auto
						case1 = Global->Opt->CASRule&1 && (state&maskLeft) == maskLeft,
						case2 = Global->Opt->CASRule&2 && (state&maskRight) == maskRight;
					if (case1 || case2)
					{
						auto maskCurrent = case1?maskLeft:maskRight;
						const auto currentWindow = Global->WindowManager->GetCurrentWindow();
						if (currentWindow->CanFastHide())
						{
							int isPanelFocus=currentWindow->GetType() == windowtype_panels;

							if (isPanelFocus)
							{
								int LeftVisible=Global->CtrlObject->Cp()->LeftPanel->IsVisible();
								int RightVisible=Global->CtrlObject->Cp()->RightPanel->IsVisible();
								int CmdLineVisible=Global->CtrlObject->CmdLine()->IsVisible();
								int KeyBarVisible=Global->CtrlObject->Cp()->GetKeybar().IsVisible();
								Manager::ShowBackground();
								Global->CtrlObject->Cp()->LeftPanel->HideButKeepSaveScreen();
								Global->CtrlObject->Cp()->RightPanel->HideButKeepSaveScreen();

								switch (Global->Opt->PanelCtrlAltShiftRule)
								{
									case 0:
										if (CmdLineVisible)
											Global->CtrlObject->CmdLine()->Show();
										if (KeyBarVisible)
											Global->CtrlObject->Cp()->GetKeybar().Show();
										break;
									case 1:
										if (KeyBarVisible)
											Global->CtrlObject->Cp()->GetKeybar().Show();
										break;
								}

								wait(maskCurrent);

								if (LeftVisible)      Global->CtrlObject->Cp()->LeftPanel->Show();
								if (RightVisible)     Global->CtrlObject->Cp()->RightPanel->Show();
								if (CmdLineVisible)   Global->CtrlObject->CmdLine()->Show();
								if (KeyBarVisible)    Global->CtrlObject->Cp()->GetKeybar().Show();
							}
							else
							{
								Global->WindowManager->ImmediateHide();
								wait(maskCurrent);
							}

							Global->WindowManager->RefreshWindow();
						}

						return TRUE;
					}
					break;
				}
			}
		}
	}
	return FALSE;
}
コード例 #2
0
ファイル: qview.cpp プロジェクト: chapgaga/farmanager
int QuickView::ProcessKey(const Manager::Key& Key)
{
	int LocalKey=Key.FarKey();
	if (!IsVisible())
		return FALSE;

	if (LocalKey>=KEY_RCTRL0 && LocalKey<=KEY_RCTRL9)
	{
		ExecShortcutFolder(LocalKey-KEY_RCTRL0);
		return TRUE;
	}

	if (LocalKey == KEY_F1)
	{
		Help::create(L"QViewPanel");
		return TRUE;
	}

	if (LocalKey==KEY_F3 || LocalKey==KEY_NUMPAD5 || LocalKey == KEY_SHIFTNUMPAD5)
	{
		auto AnotherPanel = Parent()->GetAnotherPanel(this);

		if (AnotherPanel->GetType()==FILE_PANEL)
			AnotherPanel->ProcessKey(Manager::Key(KEY_F3));

		return TRUE;
	}

	if (LocalKey==KEY_ADD || LocalKey==KEY_SUBTRACT)
	{
		auto AnotherPanel = Parent()->GetAnotherPanel(this);

		if (AnotherPanel->GetType()==FILE_PANEL)
			AnotherPanel->ProcessKey(Manager::Key(LocalKey==KEY_ADD?KEY_DOWN:KEY_UP));

		return TRUE;
	}

	if (QView && !Directory && LocalKey>=256)
	{
		int ret = QView->ProcessKey(Manager::Key(LocalKey));

		if (LocalKey == KEY_F2 || LocalKey == KEY_SHIFTF2
		 || LocalKey == KEY_F4 || LocalKey == KEY_SHIFTF4
		 || LocalKey == KEY_F8 || LocalKey == KEY_SHIFTF8)
		{
			DynamicUpdateKeyBar();
			Parent()->GetKeybar().Redraw();
		}

		if (LocalKey == KEY_F7 || LocalKey == KEY_SHIFTF7)
		{
			//__int64 Pos;
			//int Length;
			//DWORD Flags;
			//QView->GetSelectedParam(Pos,Length,Flags);
			Redraw();
			Parent()->GetAnotherPanel(this)->Redraw();
			//QView->SelectText(Pos,Length,Flags|1);
		}

		return ret;
	}

	return FALSE;
}
コード例 #3
0
ファイル: interf.cpp プロジェクト: chapgaga/farmanager
static int ConsoleScrollHook(const Manager::Key& key)
{
	// Удалить после появления макрофункции Scroll
	if (Global->Opt->WindowMode && Global->WindowManager->IsPanelsActive())
	{
		switch (key.FarKey())
		{
		case KEY_CTRLALTUP:
		case KEY_RCTRLRALTUP:
		case KEY_CTRLRALTUP:
		case KEY_RCTRLALTUP:
		case KEY_CTRLALTNUMPAD8:
		case KEY_RCTRLALTNUMPAD8:
		case KEY_CTRLRALTNUMPAD8:
		case KEY_RCTRLRALTNUMPAD8:
			Console().ScrollWindow(-1);
			return TRUE;

		case KEY_CTRLALTDOWN:
		case KEY_RCTRLRALTDOWN:
		case KEY_CTRLRALTDOWN:
		case KEY_RCTRLALTDOWN:
		case KEY_CTRLALTNUMPAD2:
		case KEY_RCTRLALTNUMPAD2:
		case KEY_CTRLRALTNUMPAD2:
		case KEY_RCTRLRALTNUMPAD2:
			Console().ScrollWindow(1);
			return TRUE;

		case KEY_CTRLALTPGUP:
		case KEY_RCTRLRALTPGUP:
		case KEY_CTRLRALTPGUP:
		case KEY_RCTRLALTPGUP:
		case KEY_CTRLALTNUMPAD9:
		case KEY_RCTRLALTNUMPAD9:
		case KEY_CTRLRALTNUMPAD9:
		case KEY_RCTRLRALTNUMPAD9:
			Console().ScrollWindow(-ScrY);
			return TRUE;

		case KEY_CTRLALTHOME:
		case KEY_RCTRLRALTHOME:
		case KEY_CTRLRALTHOME:
		case KEY_RCTRLALTHOME:
		case KEY_CTRLALTNUMPAD7:
		case KEY_RCTRLALTNUMPAD7:
		case KEY_CTRLRALTNUMPAD7:
		case KEY_RCTRLRALTNUMPAD7:
			Console().ScrollWindowToBegin();
			return TRUE;

		case KEY_CTRLALTPGDN:
		case KEY_RCTRLRALTPGDN:
		case KEY_CTRLRALTPGDN:
		case KEY_RCTRLALTPGDN:
		case KEY_CTRLALTNUMPAD3:
		case KEY_RCTRLALTNUMPAD3:
		case KEY_CTRLRALTNUMPAD3:
		case KEY_RCTRLRALTNUMPAD3:
			Console().ScrollWindow(ScrY);
			return TRUE;

		case KEY_CTRLALTEND:
		case KEY_RCTRLRALTEND:
		case KEY_CTRLRALTEND:
		case KEY_RCTRLALTEND:
		case KEY_CTRLALTNUMPAD1:
		case KEY_RCTRLALTNUMPAD1:
		case KEY_CTRLRALTNUMPAD1:
		case KEY_RCTRLRALTNUMPAD1:
			Console().ScrollWindowToEnd();
			return TRUE;
		}
	}
	return FALSE;
}
コード例 #4
0
ファイル: panel.cpp プロジェクト: johnd0e/farmanager
bool Search::ProcessKey(const Manager::Key& Key)
{
	auto LocalKey = Key;

	// для вставки воспользуемся макродвижком...
	if (LocalKey()==KEY_CTRLV || LocalKey()==KEY_RCTRLV || LocalKey()==KEY_SHIFTINS || LocalKey()==KEY_SHIFTNUMPAD0)
	{
		string ClipText;
		if (GetClipboardText(ClipText))
		{
			if (!ClipText.empty())
			{
				ProcessName(ClipText);
				ShowBorder();
			}
		}

		return true;
	}
	else if (LocalKey() == KEY_OP_XLAT)
	{
		m_FindEdit->Xlat();
		const auto strTempName = m_FindEdit->GetString();
		m_FindEdit->ClearString();
		ProcessName(strTempName);
		Redraw();
		return true;
	}
	else if (LocalKey() == KEY_OP_PLAINTEXT)
	{
		m_FindEdit->ProcessKey(LocalKey);
		const auto strTempName = m_FindEdit->GetString();
		m_FindEdit->ClearString();
		ProcessName(strTempName);
		Redraw();
		return true;
	}
	else
		LocalKey=_CorrectFastFindKbdLayout(Key.Event(),LocalKey());

	if (LocalKey()==KEY_ESC || LocalKey()==KEY_F10)
	{
		m_KeyToProcess=KEY_NONE;
		Close();
		return true;
	}

	// // _SVS(if (!FirstKey) SysLog(L"Panel::FastFind  Key=%s  %s",_FARKEY_ToName(Key),_INPUT_RECORD_Dump(&rec)));
	if (LocalKey()>=KEY_ALT_BASE+0x01 && LocalKey()<=KEY_ALT_BASE+65535)
		LocalKey=lower(static_cast<WCHAR>(LocalKey()-KEY_ALT_BASE));
	else if (LocalKey()>=KEY_RALT_BASE+0x01 && LocalKey()<=KEY_RALT_BASE+65535)
		LocalKey=lower(static_cast<WCHAR>(LocalKey()-KEY_RALT_BASE));

	if (LocalKey()>=KEY_ALTSHIFT_BASE+0x01 && LocalKey()<=KEY_ALTSHIFT_BASE+65535)
		LocalKey=lower(static_cast<WCHAR>(LocalKey()-KEY_ALTSHIFT_BASE));
	else if (LocalKey()>=KEY_RALTSHIFT_BASE+0x01 && LocalKey()<=KEY_RALTSHIFT_BASE+65535)
		LocalKey=lower(static_cast<WCHAR>(LocalKey()-KEY_RALTSHIFT_BASE));

	if (LocalKey()==KEY_MULTIPLY)
		LocalKey=L'*';

	switch (LocalKey())
	{
		case KEY_F1:
		{
			Hide();
			{
				Help::create(L"FastFind"sv);
			}
			Show();
			break;
		}
		case KEY_CTRLNUMENTER:   case KEY_RCTRLNUMENTER:
		case KEY_CTRLENTER:      case KEY_RCTRLENTER:
			m_Owner->FindPartName(m_FindEdit->GetString(), TRUE, 1);
			Redraw();
			break;
		case KEY_CTRLSHIFTNUMENTER:  case KEY_RCTRLSHIFTNUMENTER:
		case KEY_CTRLSHIFTENTER:     case KEY_RCTRLSHIFTENTER:
			m_Owner->FindPartName(m_FindEdit->GetString(), TRUE, -1);
			Redraw();
			break;
		case KEY_NONE:
		case KEY_IDLE:
			break;
		default:

			if ((LocalKey()<32 || LocalKey()>=65536) && LocalKey()!=KEY_BS && LocalKey()!=KEY_CTRLY && LocalKey()!=KEY_RCTRLY &&
			        LocalKey()!=KEY_CTRLBS && LocalKey()!=KEY_RCTRLBS && !IsModifKey(LocalKey()) &&
			        !(LocalKey()==KEY_CTRLINS||LocalKey()==KEY_CTRLNUMPAD0) && // KEY_RCTRLINS/NUMPAD0 passed to panels
			        !(LocalKey()==KEY_SHIFTINS||LocalKey()==KEY_SHIFTNUMPAD0) &&
			        !((LocalKey() == KEY_KILLFOCUS || LocalKey() == KEY_GOTFOCUS) && IsWindowsVistaOrGreater()) // Mantis #2903
			        )
			{
				m_KeyToProcess=LocalKey;
				Close();
				return true;
			}
			auto strLastName = m_FindEdit->GetString();
			if (m_FindEdit->ProcessKey(LocalKey))
			{
				auto strName = m_FindEdit->GetString();

				// уберем двойные '**'
				if (strName.size() > 1
				        && strName.back() == L'*'
				        && strName[strName.size()-2] == L'*')
				{
					strName.pop_back();
					m_FindEdit->SetString(strName);
				}

				/* $ 09.04.2001 SVS
				   проблемы с быстрым поиском.
				   Подробнее в 00573.ChangeDirCrash.txt
				*/
				if (starts_with(strName, L'"'))
				{
					strName.erase(0, 1);
					m_FindEdit->SetString(strName);
				}

				if (m_Owner->FindPartName(strName, FALSE, 1))
				{
					strLastName = strName;
				}
				else
				{
					if (Global->CtrlObject->Macro.IsExecuting())// && Global->CtrlObject->Macro.GetLevelState() > 0) // если вставка макросом...
					{
						//Global->CtrlObject->Macro.DropProcess(); // ... то дропнем макропроцесс
						//Global->CtrlObject->Macro.PopState();
						;
					}

					m_FindEdit->SetString(strLastName);
				}

				Redraw();
			}

			break;
	}
	return true;
}
コード例 #5
0
ファイル: foldtree.cpp プロジェクト: chapgaga/farmanager
int FolderTree::ProcessKey(const Manager::Key& Key)
{
	int LocalKey=Key.FarKey();
	if (LocalKey>=KEY_ALT_BASE+0x01 && LocalKey<=KEY_ALT_BASE+65535)
		LocalKey=ToLower(LocalKey-KEY_ALT_BASE);
	else if (LocalKey>=KEY_RALT_BASE+0x01 && LocalKey<=KEY_RALT_BASE+65535)
		LocalKey=ToLower(LocalKey-KEY_RALT_BASE);

	switch (LocalKey)
	{
		case KEY_F1:
		{
			Help::create(L"FindFolder");
		}
		break;
		case KEY_ESC:
		case KEY_F10:
			Global->WindowManager->DeleteWindow();
			SetExitCode(XC_MODIFIED);
			break;
		case KEY_NUMENTER:
		case KEY_ENTER:
			strNewFolder = Tree->GetCurDir();

			if (os::fs::exists(strNewFolder))
			{
				Global->WindowManager->DeleteWindow();
				SetExitCode(XC_MODIFIED);
			}
			else
			{
				Tree->ProcessKey(Manager::Key(KEY_ENTER));
				DrawEdit();
			}

			break;
		case KEY_F5:
			IsFullScreen=!IsFullScreen;
			ResizeConsole();
			Show();
			return TRUE;
		case KEY_CTRLR:		case KEY_RCTRLR:
		case KEY_F2:
			Tree->ProcessKey(Manager::Key(KEY_CTRLR));
			DrawEdit();
			break;
		case KEY_CTRLNUMENTER:       case KEY_RCTRLNUMENTER:
		case KEY_CTRLSHIFTNUMENTER:  case KEY_RCTRLSHIFTNUMENTER:
		case KEY_CTRLENTER:          case KEY_RCTRLENTER:
		case KEY_CTRLSHIFTENTER:     case KEY_RCTRLSHIFTENTER:
		{
			string strName;
			FindEdit->GetString(strName);
			Tree->FindPartName(strName, TRUE, LocalKey == KEY_CTRLSHIFTENTER || LocalKey == KEY_RCTRLSHIFTENTER || LocalKey == KEY_CTRLSHIFTNUMENTER || LocalKey == KEY_RCTRLSHIFTNUMENTER? -1 : 1);
			DrawEdit();
		}
		break;
		case KEY_UP:
		case KEY_NUMPAD8:
		case KEY_DOWN:
		case KEY_NUMPAD2:
		case KEY_PGUP:
		case KEY_NUMPAD9:
		case KEY_PGDN:
		case KEY_NUMPAD3:
		case KEY_HOME:
		case KEY_NUMPAD7:
		case KEY_END:
		case KEY_NUMPAD1:
		case KEY_MSWHEEL_UP:
		case(KEY_MSWHEEL_UP | KEY_ALT):
		case(KEY_MSWHEEL_UP | KEY_RALT):
		case KEY_MSWHEEL_DOWN:
		case(KEY_MSWHEEL_DOWN | KEY_ALT):
		case(KEY_MSWHEEL_DOWN | KEY_RALT):
			FindEdit->SetString(L"");
			Tree->ProcessKey(Key);
			DrawEdit();
			break;
		default:

			if (LocalKey == KEY_ADD || LocalKey == KEY_SUBTRACT) // OFM: Gray+/Gray- navigation
			{
				Tree->ProcessKey(Key);
				DrawEdit();
				break;
			}

			/*
			      else
			      {
			        if((Key&(~KEY_CTRLMASK)) == KEY_ADD)
			          Key='+';
			        else if((Key&(~KEY_CTRLMASK)) == KEY_SUBTRACT)
			          Key='-';
			      }
			*/
			if (FindEdit->ProcessKey(Key))
			{
				string strName;
				FindEdit->GetString(strName);

				if (Tree->FindPartName(strName, FALSE, 1))
					strLastName = strName;
				else
				{
					FindEdit->SetString(strLastName.data());
					strName = strLastName;
				}

				DrawEdit();
			}

			break;
	}

	return TRUE;
}
コード例 #6
0
ファイル: filepanels.cpp プロジェクト: Firebie/FarManager
int FilePanels::ProcessKey(const Manager::Key& Key)
{
	auto LocalKey = Key.FarKey();
	if (!LocalKey)
		return TRUE;

	if ((LocalKey==KEY_CTRLLEFT || LocalKey==KEY_CTRLRIGHT || LocalKey==KEY_CTRLNUMPAD4 || LocalKey==KEY_CTRLNUMPAD6
		|| LocalKey==KEY_RCTRLLEFT || LocalKey==KEY_RCTRLRIGHT || LocalKey==KEY_RCTRLNUMPAD4 || LocalKey==KEY_RCTRLNUMPAD6
	        /* || LocalKey==KEY_CTRLUP   || LocalKey==KEY_CTRLDOWN || LocalKey==KEY_CTRLNUMPAD8 || LocalKey==KEY_CTRLNUMPAD2 */) &&
	        (CmdLine->GetLength()>0 ||
	         (!LeftPanel->IsVisible() && !RightPanel->IsVisible())))
	{
		CmdLine->ProcessKey(Key);
		return TRUE;
	}

	switch (LocalKey)
	{
		case KEY_F1:
		{
			if (!m_ActivePanel->ProcessKey(Manager::Key(KEY_F1)))
			{
				Help::create(L"Contents");
			}

			return TRUE;
		}
		case KEY_TAB:
		{
			SetAnhoterPanelFocus();
			break;
		}
		case KEY_CTRLF1:
		case KEY_RCTRLF1:
		{
			if (LeftPanel->IsVisible())
			{
				LeftPanel->Hide();

				if (RightPanel->IsVisible())
					RightPanel->SetFocus();
			}
			else
			{
				if (!RightPanel->IsVisible())
					LeftPanel->SetFocus();

				LeftPanel->Show();
			}

			Redraw();
			break;
		}
		case KEY_CTRLF2:
		case KEY_RCTRLF2:
		{
			if (RightPanel->IsVisible())
			{
				RightPanel->Hide();

				if (LeftPanel->IsVisible())
					LeftPanel->SetFocus();
			}
			else
			{
				if (!LeftPanel->IsVisible())
					RightPanel->SetFocus();

				RightPanel->Show();
			}

			Redraw();
			break;
		}
		case KEY_CTRLB:
		case KEY_RCTRLB:
		{
			Global->Opt->ShowKeyBar=!Global->Opt->ShowKeyBar;
			m_KeyBarVisible = Global->Opt->ShowKeyBar;

			if (!m_KeyBarVisible)
				m_windowKeyBar->Hide();

			SetScreenPosition();
			Global->WindowManager->RefreshWindow();
			break;
		}
		case KEY_CTRLT: case KEY_RCTRLT:
			if (Global->Opt->Tree.TurnOffCompletely)
				break;
		case KEY_CTRLL: case KEY_RCTRLL:
		case KEY_CTRLQ: case KEY_RCTRLQ:
		{
			if (m_ActivePanel->IsVisible())
			{
				Panel *AnotherPanel = PassivePanel();
				int NewType;

				if (LocalKey==KEY_CTRLL || LocalKey==KEY_RCTRLL)
					NewType=INFO_PANEL;
				else if (LocalKey==KEY_CTRLQ || LocalKey==KEY_RCTRLQ)
					NewType=QVIEW_PANEL;
				else
					NewType=TREE_PANEL;

				if (m_ActivePanel->GetType() == NewType)
					AnotherPanel = m_ActivePanel;

				if (!AnotherPanel->ProcessPluginEvent(FE_CLOSE,nullptr))
				{
					if (AnotherPanel->GetType()==NewType)
						/* $ 19.09.2000 IS
						  Повторное нажатие на ctrl-l|q|t всегда включает файловую панель
						*/
						AnotherPanel=ChangePanel(AnotherPanel,FILE_PANEL,FALSE,FALSE);
					else
						AnotherPanel=ChangePanel(AnotherPanel,NewType,FALSE,FALSE);

					/* $ 07.09.2001 VVM
					  ! При возврате из CTRL+Q, CTRL+L восстановим каталог, если активная панель - дерево. */
					if (m_ActivePanel->GetType() == TREE_PANEL)
					{
						string strCurDir(m_ActivePanel->GetCurDir());
						AnotherPanel->SetCurDir(strCurDir, true);
						AnotherPanel->Update(0);
					}
					else
						AnotherPanel->Update(UPDATE_KEEP_SELECTION);

					AnotherPanel->Show();
				}

				m_ActivePanel->SetFocus();
			}

			break;
		}
		case KEY_CTRLO:
		case KEY_RCTRLO:
		{
			{
				int LeftVisible=LeftPanel->IsVisible();
				int RightVisible=RightPanel->IsVisible();
				int HideState=!LeftVisible && !RightVisible;

				if (!HideState)
				{
					LeftStateBeforeHide=LeftVisible;
					RightStateBeforeHide=RightVisible;
					LeftPanel->Hide();
					RightPanel->Hide();
					Global->WindowManager->RefreshWindow();
				}
				else
				{
					if (!LeftStateBeforeHide && !RightStateBeforeHide)
						LeftStateBeforeHide=RightStateBeforeHide=TRUE;

					if (LeftStateBeforeHide)
						LeftPanel->Show();

					if (RightStateBeforeHide)
						RightPanel->Show();

					if (!m_ActivePanel->IsVisible())
					{
						if (m_ActivePanel == RightPanel)
							LeftPanel->SetFocus();
						else
							RightPanel->SetFocus();
					}
				}
			}
			break;
		}
		case KEY_CTRLP:
		case KEY_RCTRLP:
		{
			if (m_ActivePanel->IsVisible())
			{
				Panel *AnotherPanel = PassivePanel();

				if (AnotherPanel->IsVisible())
					AnotherPanel->Hide();
				else
					AnotherPanel->Show();

				CmdLine->Redraw();
			}

			Global->WindowManager->RefreshWindow();
			break;
		}
		case KEY_CTRLI:
		case KEY_RCTRLI:
		{
			m_ActivePanel->EditFilter();
			return TRUE;
		}
		case KEY_CTRLU:
		case KEY_RCTRLU:
		{
			if (!LeftPanel->IsVisible() && !RightPanel->IsVisible())
				CmdLine->ProcessKey(Key);
			else
				SwapPanels();

			break;
		}
		/* $ 08.04.2002 IS
		   При смене диска установим принудительно текущий каталог на активной
		   панели, т.к. система не знает ничего о том, что у Фара две панели, и
		   текущим для системы после смены диска может быть каталог и на пассивной
		   панели
		*/
		case KEY_ALTF1:
		case KEY_RALTF1:
		{
			LeftPanel->ChangeDisk();

			if (ActivePanel() != LeftPanel)
				ActivePanel()->SetCurPath();

			break;
		}
		case KEY_ALTF2:
		case KEY_RALTF2:
		{
			RightPanel->ChangeDisk();

			if (ActivePanel() != RightPanel)
				ActivePanel()->SetCurPath();

			break;
		}
		case KEY_ALTF7:
		case KEY_RALTF7:
		{
			FindFiles();
			break;
		}
		case KEY_CTRLUP:  case KEY_CTRLNUMPAD8:
		case KEY_RCTRLUP: case KEY_RCTRLNUMPAD8:
		{
			bool Set=false;
			if (Global->Opt->LeftHeightDecrement<ScrY-7)
			{
				++Global->Opt->LeftHeightDecrement;
				Set=true;
			}
			if (Global->Opt->RightHeightDecrement<ScrY-7)
			{
				++Global->Opt->RightHeightDecrement;
				Set=true;
			}
			if(Set)
			{
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}

			break;
		}
		case KEY_CTRLDOWN:  case KEY_CTRLNUMPAD2:
		case KEY_RCTRLDOWN: case KEY_RCTRLNUMPAD2:
		{
			bool Set=false;
			if (Global->Opt->LeftHeightDecrement>0)
			{
				--Global->Opt->LeftHeightDecrement;
				Set=true;
			}
			if (Global->Opt->RightHeightDecrement>0)
			{
				--Global->Opt->RightHeightDecrement;
				Set=true;
			}
			if(Set)
			{
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}

			break;
		}

		case KEY_CTRLSHIFTUP:  case KEY_CTRLSHIFTNUMPAD8:
		case KEY_RCTRLSHIFTUP: case KEY_RCTRLSHIFTNUMPAD8:
		{
			IntOption& HeightDecrement = (m_ActivePanel == LeftPanel) ? Global->Opt->LeftHeightDecrement : Global->Opt->RightHeightDecrement;
			if (HeightDecrement<ScrY-7)
			{
				++HeightDecrement;
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}
			break;
		}

		case KEY_CTRLSHIFTDOWN:  case KEY_CTRLSHIFTNUMPAD2:
		case KEY_RCTRLSHIFTDOWN: case KEY_RCTRLSHIFTNUMPAD2:
		{
			IntOption& HeightDecrement = (m_ActivePanel == LeftPanel) ? Global->Opt->LeftHeightDecrement : Global->Opt->RightHeightDecrement;
			if (HeightDecrement>0)
			{
				--HeightDecrement;
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}
			break;
		}

		case KEY_CTRLLEFT:  case KEY_CTRLNUMPAD4:
		case KEY_RCTRLLEFT: case KEY_RCTRLNUMPAD4:
		{
			if (Global->Opt->WidthDecrement<ScrX/2-10)
			{
				++Global->Opt->WidthDecrement;
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}

			break;
		}
		case KEY_CTRLRIGHT:  case KEY_CTRLNUMPAD6:
		case KEY_RCTRLRIGHT: case KEY_RCTRLNUMPAD6:
		{
			if (Global->Opt->WidthDecrement>-(ScrX/2-10))
			{
				--Global->Opt->WidthDecrement;
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}

			break;
		}
		case KEY_CTRLCLEAR:
		case KEY_RCTRLCLEAR:
		{
			if (Global->Opt->WidthDecrement)
			{
				Global->Opt->WidthDecrement=0;
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}

			break;
		}
		case KEY_CTRLALTCLEAR:
		case KEY_RCTRLRALTCLEAR:
		case KEY_CTRLRALTCLEAR:
		case KEY_RCTRLALTCLEAR:
		{
			bool Set=false;
			if (Global->Opt->LeftHeightDecrement)
			{
				Global->Opt->LeftHeightDecrement=0;
				Set=true;
			}
			if (Global->Opt->RightHeightDecrement)
			{
				Global->Opt->RightHeightDecrement=0;
				Set=true;
			}
			if(Set)
			{
				SetScreenPosition();
				Global->WindowManager->RefreshWindow();
			}

			break;
		}
		case KEY_F9:
		{
			Global->Opt->ShellOptions(false,nullptr);
			return TRUE;
		}
		case KEY_SHIFTF10:
		{
			Global->Opt->ShellOptions(true,nullptr);
			return TRUE;
		}
		case KEY_F11:
		{
			// We will never get here in normal flow since F11 is processed by manager itself,
			// but auto-completion menu can forward keys back to the owner
			return Global->WindowManager->ProcessKey(Key);
		}
		default:
		{
			if (LocalKey >= KEY_CTRL0 && LocalKey <= KEY_CTRL9)
				ChangePanelViewMode(m_ActivePanel, LocalKey - KEY_CTRL0, TRUE);
			if (!m_ActivePanel->ProcessKey(Key))
				CmdLine->ProcessKey(Key);

			break;
		}
	}

	return TRUE;
}