summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-11-14 09:26:03 +0000
committerIra Rice <irarice@gmail.com>2009-01-06 15:35:13 -0700
commitb57cc8e3e29cb7c1004fdbd041173fcd4a2c1782 (patch)
tree9526b20b849f607c8893396a6bb874d12ee2c2ca /src/gui/chat.cpp
parent8cb177d47fb23408d9b964b4c5fd24782c242401 (diff)
downloadmana-b57cc8e3e29cb7c1004fdbd041173fcd4a2c1782.tar.gz
mana-b57cc8e3e29cb7c1004fdbd041173fcd4a2c1782.tar.bz2
mana-b57cc8e3e29cb7c1004fdbd041173fcd4a2c1782.tar.xz
mana-b57cc8e3e29cb7c1004fdbd041173fcd4a2c1782.zip
Fixed up and down arrows in chat box.
(cherry picked from commit cb04d148c9aed572fe6e66313100e2cd9b66f5d5) Conflicts: src/gui/chat.cpp
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp14
1 files changed, 9 insertions, 5 deletions
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 <fstream>
#include <guichan/focushandler.hpp>
-#include <guichan/key.hpp>
#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);