summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 6c6580f21..59b7377f4 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -28,6 +28,7 @@
#include "configuration.h"
#include "graphics.h"
#include "itemshortcut.h"
+#include "inputmanager.h"
#include "keyboardconfig.h"
#include "localplayer.h"
#include "map.h"
@@ -504,17 +505,17 @@ void Viewport::mousePressed(gcn::MouseEvent &event)
}
}
else if (player_node->withinAttackRange(mHoverBeing) ||
- keyboard.isActionActive(Input::KEY_ATTACK))
+ inputManager.isActionActive(Input::KEY_ATTACK))
{
validateSpeed();
if (player_node != mHoverBeing)
{
player_node->attack(mHoverBeing,
- !keyboard.isActionActive(Input::KEY_TARGET));
+ !inputManager.isActionActive(Input::KEY_TARGET));
return;
}
}
- else if (!keyboard.isActionActive(Input::KEY_ATTACK))
+ else if (!inputManager.isActionActive(Input::KEY_ATTACK))
{
validateSpeed();
if (player_node != mHoverBeing)
@@ -532,7 +533,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event)
player_node->pickUp(mHoverItem);
}
// Just walk around
- else if (!keyboard.isActionActive(Input::KEY_ATTACK))
+ else if (!inputManager.isActionActive(Input::KEY_ATTACK))
{
validateSpeed();
player_node->stopAttack();
@@ -933,8 +934,8 @@ void Viewport::returnCamera()
void Viewport::validateSpeed()
{
- if (!keyboard.isActionActive(Input::KEY_TARGET_ATTACK)
- && !keyboard.isActionActive(Input::KEY_ATTACK))
+ if (!inputManager.isActionActive(Input::KEY_TARGET_ATTACK)
+ && !inputManager.isActionActive(Input::KEY_ATTACK))
{
if (Game::instance())
Game::instance()->setValidSpeed();