From 43271f76186ccf700035d6cb5e89eea2b46efee9 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 1 Jan 2005 18:12:23 +0000 Subject: [PATCH] Ctrl+home, ctrl+end go to top/bottom of console This was SVN commit r1609. --- source/ps/CConsole.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index 4b146c1e87..f1d705807e 100755 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -334,11 +334,26 @@ void CConsole::InsertChar(const int szChar, const wchar_t cooked ) return; case SDLK_HOME: - m_iBufferPos = 0; + if (keys[SDLK_RCTRL] || keys[SDLK_LCTRL]) + { + int linesShown = (int)m_fHeight/m_iFontHeight - 4; + m_iMsgHistPos = clamp((int)m_deqMsgHistory.size() - linesShown, 1, (int)m_deqMsgHistory.size()); + } + else + { + m_iBufferPos = 0; + } return; case SDLK_END: - m_iBufferPos = m_iBufferLength; + if (keys[SDLK_RCTRL] || keys[SDLK_LCTRL]) + { + m_iMsgHistPos = 1; + } + else + { + m_iBufferPos = m_iBufferLength; + } return; case SDLK_LEFT: