aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_stack.h
diff options
context:
space:
mode:
authorBastien Bouclet2017-08-06 06:33:20 +0200
committerBastien Bouclet2017-08-06 17:36:27 +0200
commit8e5ac98a4b6082caf68ad205dc6cadffa4df5051 (patch)
treeaffe658ec773193cdaeb5f0a0cf9465e4c8b5169 /engines/mohawk/riven_stack.h
parent17089becd410e4e1b95e64c9d0207ffc3eac5801 (diff)
downloadscummvm-rg350-8e5ac98a4b6082caf68ad205dc6cadffa4df5051.tar.gz
scummvm-rg350-8e5ac98a4b6082caf68ad205dc6cadffa4df5051.tar.bz2
scummvm-rg350-8e5ac98a4b6082caf68ad205dc6cadffa4df5051.zip
MOHAWK: Riven: Add keyboard navigation
Diffstat (limited to 'engines/mohawk/riven_stack.h')
-rw-r--r--engines/mohawk/riven_stack.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/engines/mohawk/riven_stack.h b/engines/mohawk/riven_stack.h
index 740dff8adc..ce7d2e203d 100644
--- a/engines/mohawk/riven_stack.h
+++ b/engines/mohawk/riven_stack.h
@@ -70,6 +70,20 @@ private:
Common::Array<uint16> _index;
};
+/** Actions that can be performed using the keyboard */
+enum RivenKeyAction {
+ kKeyActionNone,
+ kKeyActionSkip,
+ kKeyActionMoveForward,
+ kKeyActionMoveForwardLeft,
+ kKeyActionMoveForwardRight,
+ kKeyActionMoveLeft,
+ kKeyActionMoveRight,
+ kKeyActionMoveBack,
+ kKeyActionLookUp,
+ kKeyActionLookDown
+};
+
/**
* A game level
*
@@ -152,13 +166,13 @@ public:
void mouseForceUp();
/** Handle a key press event */
- void onKeyPressed(const Common::KeyCode keyCode);
+ void onKeyPressed(const Common::KeyState &keyState);
- /** Get the pressed keyboard key if any */
- Common::KeyCode keyGetPressed() const;
+ /** Get the action for the pressed keyboard key, if any */
+ RivenKeyAction keyGetAction() const;
/** Force the keyboard to be considered unpressed until the next key press */
- void keyForceUp();
+ void keyResetAction();
// Common external commands
void xflies(const ArgumentArray &args); // Start the "flies" effect
@@ -210,7 +224,8 @@ private:
CommandsMap _commands;
- Common::KeyCode _keyPressed;
+ RivenKeyAction _keyAction;
+ RivenKeyAction mapKeyStateToKeyAction(const Common::KeyState &keyState);
bool _mouseIsDown;
Common::Point _mousePosition;