summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2011-11-19 13:12:16 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2011-11-19 13:12:16 +0800
commit701b4463019c08fbc30ed81d389fc995f0c0c106 (patch)
treee8095c725d9cd5bc1fc708834a4c7cb256943dc8
parentd62372bb23dd5c054ac0a33bb4d8aed22db622d6 (diff)
SexyAppFramework: Added joystick axis moved events support
-rw-r--r--osframework/source/SexyAppFramework/Widget.cpp14
-rw-r--r--osframework/source/SexyAppFramework/Widget.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/osframework/source/SexyAppFramework/Widget.cpp b/osframework/source/SexyAppFramework/Widget.cpp
index 8100734..6a91c2b 100644
--- a/osframework/source/SexyAppFramework/Widget.cpp
+++ b/osframework/source/SexyAppFramework/Widget.cpp
@@ -739,6 +739,20 @@ bool Widget::OnKeyEscape()
return true;
}
+bool Widget::AxisMoved(const Event& event)
+{
+ WidgetVector::iterator it;
+ for (it = mSortedWidgets.begin(); it != mSortedWidgets.end(); ++it)
+ {
+ if ((*it)->mHasFocus && (*it)->IsFocusable())
+ break;
+ }
+ if (it != mSortedWidgets.end())
+ return (*it)->AxisMoved(event);
+
+ return false;
+}
+
bool Widget::KeyDown(KeyCode theKey)
{
if (theKey == KEYCODE_UP || theKey == KEYCODE_DOWN ||
diff --git a/osframework/source/SexyAppFramework/Widget.h b/osframework/source/SexyAppFramework/Widget.h
index aafa191..86d5441 100644
--- a/osframework/source/SexyAppFramework/Widget.h
+++ b/osframework/source/SexyAppFramework/Widget.h
@@ -115,6 +115,7 @@ public:
virtual void TouchUp(const TouchVector &touches);
virtual void TouchCancel(const TouchVector &touches);
virtual void MouseWheel(int theDelta);
+ virtual bool AxisMoved(const Event& event);
virtual void UserEvent(const Event event);
virtual bool IsPointVisible(int x, int y);