From b57cc8e3e29cb7c1004fdbd041173fcd4a2c1782 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Wed, 14 Nov 2007 09:26:03 +0000 Subject: Fixed up and down arrows in chat box. (cherry picked from commit cb04d148c9aed572fe6e66313100e2cd9b66f5d5) Conflicts: src/gui/chat.cpp --- src/gui/chat.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/gui/chat.cpp') diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 34e7b04b..71954601 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -23,12 +23,12 @@ #include #include -#include #include "browserbox.h" #include "chat.h" #include "chatinput.h" #include "scrollarea.h" +#include "sdlinput.h" #include "windowcontainer.h" #include "../beingmanager.h" @@ -584,8 +584,10 @@ void ChatWindow::scroll(int amount) void ChatWindow::keyPressed(gcn::KeyEvent & event) { - if (event.getKey().getValue() == gcn::Key::DOWN && - mCurHist != mHistory.end()) { + + if (event.getKey().getValue() == Key::DOWN && + mCurHist != mHistory.end()) + { // Move forward through the history HistoryIterator prevHist = mCurHist++; if (mCurHist != mHistory.end()) { @@ -594,8 +596,10 @@ void ChatWindow::keyPressed(gcn::KeyEvent & event) } else { mCurHist = prevHist; } - } else if (event.getKey().getValue() == gcn::Key::UP && - mCurHist != mHistory.begin() && mHistory.size() > 0) { + } + else if (event.getKey().getValue() == Key::UP && + mCurHist != mHistory.begin() && mHistory.size() > 0) + { // Move backward through the history mCurHist--; mChatInput->setText(*mCurHist); -- cgit v1.2.3-70-g09d2