aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorChris Warren-Smith2011-08-10 06:59:23 +1000
committerChris Warren-Smith2011-08-21 16:38:42 +1000
commit533dc5f8e4d209fb721d64bce36a44bd14ede4c2 (patch)
tree557abf5695d49f5460f32da767ebc0cbc6023189 /backends/platform
parentd6f7e5933657e2e6fcbd1accf9f8a4b77454daec (diff)
downloadscummvm-rg350-533dc5f8e4d209fb721d64bce36a44bd14ede4c2.tar.gz
scummvm-rg350-533dc5f8e4d209fb721d64bce36a44bd14ede4c2.tar.bz2
scummvm-rg350-533dc5f8e4d209fb721d64bce36a44bd14ede4c2.zip
BADA: Camera button can now set shortcuts
Diffstat (limited to 'backends/platform')
-rwxr-xr-xbackends/platform/bada/form.cpp57
-rwxr-xr-xbackends/platform/bada/form.h3
2 files changed, 38 insertions, 22 deletions
diff --git a/backends/platform/bada/form.cpp b/backends/platform/bada/form.cpp
index eb9c828b1b..8546c12345 100755
--- a/backends/platform/bada/form.cpp
+++ b/backends/platform/bada/form.cpp
@@ -284,6 +284,26 @@ void BadaAppForm::setVolume(bool up, bool minMax) {
}
}
+void BadaAppForm::setShortcut() {
+ int index = getShortcutIndex();
+ _shortcutIndex = (index == -1 ? 0 : index + 1);
+ _shortcutTimer = g_system->getMillis();
+
+ switch (_shortcutIndex) {
+ case SHORTCUT_F5:
+ g_system->displayMessageOnOSD(_("Game Menu"));
+ break;
+
+ case SHORTCUT_ESCAPE:
+ g_system->displayMessageOnOSD(_("Escape"));
+ break;
+
+ default:
+ g_system->displayMessageOnOSD(_("Set Buttons"));
+ _shortcutIndex = SHORTCUT_SWAP_MOUSE;
+ }
+}
+
void BadaAppForm::OnTouchDoublePressed(const Control &source,
const Point &currentPosition,
const TouchEventInfo &touchInfo) {
@@ -327,24 +347,8 @@ void BadaAppForm::OnTouchPressed(const Control &source,
Touch touch;
_touchCount = touch.GetPointCount();
if (_touchCount > 1) {
- int index = getShortcutIndex();
- _shortcutIndex = (index == -1 ? 0 : index + 1);
- _shortcutTimer = g_system->getMillis();
-
- switch (_shortcutIndex) {
- case SHORTCUT_F5:
- g_system->displayMessageOnOSD(_("Game Menu"));
- break;
-
- case SHORTCUT_ESCAPE:
- g_system->displayMessageOnOSD(_("Escape"));
- break;
-
- default:
- g_system->displayMessageOnOSD(_("Swap Buttons"));
- _shortcutIndex = SHORTCUT_SWAP_MOUSE;
- }
- } else if (getShortcutIndex() == -1) {
+ setShortcut();
+ } else if (getShortcutIndex() == -1 && _buttonState != MoveOnly) {
pushEvent(_buttonState == LeftButton ? Common::EVENT_LBUTTONDOWN : Common::EVENT_RBUTTONDOWN,
currentPosition);
}
@@ -369,14 +373,18 @@ void BadaAppForm::OnTouchReleased(const Control &source,
case SHORTCUT_SWAP_MOUSE:
switch (_buttonState) {
case LeftButton:
- _buttonState = RightButtonOnce;
g_system->displayMessageOnOSD(_("Right Once"));
+ _buttonState = RightButtonOnce;
break;
case RightButtonOnce:
g_system->displayMessageOnOSD(_("Right Active"));
_buttonState = RightButton;
break;
case RightButton:
+ g_system->displayMessageOnOSD(_("Move Active"));
+ _buttonState = MoveOnly;
+ break;
+ case MoveOnly:
g_system->displayMessageOnOSD(_("Left Active"));
_buttonState = LeftButton;
break;
@@ -409,6 +417,13 @@ void BadaAppForm::OnKeyLongPressed(const Control &source, KeyCode keyCode) {
setVolume(false, true);
return;
+ case KEY_CAMERA:
+ // display the soft keyboard
+ _buttonState = LeftButton;
+ _shortcutTimer = -1;
+ pushKey(Common::KEYCODE_F7);
+ return;
+
default:
break;
}
@@ -425,8 +440,8 @@ void BadaAppForm::OnKeyPressed(const Control &source, KeyCode keyCode) {
return;
case KEY_CAMERA:
- // display the soft keyboard
- pushKey(Common::KEYCODE_F7);
+ _touchCount = 1;
+ setShortcut();
return;
default:
diff --git a/backends/platform/bada/form.h b/backends/platform/bada/form.h
index 157cc8e365..6d0b491b37 100755
--- a/backends/platform/bada/form.h
+++ b/backends/platform/bada/form.h
@@ -91,6 +91,7 @@ private:
void pushEvent(Common::EventType type,
const Osp::Graphics::Point &currentPosition);
void terminate();
+ void setShortcut();
void setVolume(bool up, bool minMax);
int getShortcutIndex();
@@ -99,7 +100,7 @@ private:
Osp::Base::Runtime::Mutex *_eventQueueLock;
Common::Queue<Common::Event> _eventQueue;
enum {InitState, ActiveState, ClosingState, DoneState, ErrorState} _state;
- enum {LeftButton, RightButtonOnce, RightButton} _buttonState;
+ enum {LeftButton, RightButtonOnce, RightButton, MoveOnly} _buttonState;
uint32 _shortcutTimer;
int _shortcutIndex;
int _touchCount;