- Allows writing on sdcard

- Bound "back" key to menu, "volume down" to next phase and "volume down" to interrupt ... like on the N900 :)
This commit is contained in:
Xawotihs
2011-04-27 21:19:25 +00:00
parent 86042c206a
commit 7e4364b484
2 changed files with 35 additions and 19 deletions
+19 -4
View File
@@ -108,7 +108,7 @@ class SdlApp {
void OnMouseClicked(const SDL_MouseButtonEvent& event); void OnMouseClicked(const SDL_MouseButtonEvent& event);
void OnMouseMoved(const SDL_MouseMotionEvent& event); void OnMouseMoved(const SDL_MouseMotionEvent& event);
void OnEvent(SDL_Event* Event) { void OnEvent(SDL_Event* Event) {
if(Event->type < SDL_USEREVENT) DebugTrace("Received Event : " << Event->type); if(Event->type < SDL_USEREVENT) DebugTrace("Event received" << Event->type);
switch(Event->type){ switch(Event->type){
case SDL_QUIT: case SDL_QUIT:
{ {
@@ -149,9 +149,19 @@ class SdlApp {
lastMouseUpTime = eventTime; lastMouseUpTime = eventTime;
break; break;
} }
case WAGIC_UPDATE_EVENT: case SDL_FINGERMOTION:
OnUpdate(); {
DebugTrace("FingerMotion : touchId " << Event->tfinger.touchId
<< ", fingerId " << Event->tfinger.fingerId
<< ", state " << Event->tfinger.state
<< ", x " << Event->tfinger.x
<< ", y " << Event->tfinger.y
<< ", dy " << Event->tfinger.dx
<< ", dy " << Event->tfinger.dy
<< ", pressure " << Event->tfinger.pressure
);
break; break;
}
case SDL_MULTIGESTURE: case SDL_MULTIGESTURE:
{ {
DebugTrace("Multigesure : touchId " << Event->mgesture.touchId DebugTrace("Multigesure : touchId " << Event->mgesture.touchId
@@ -162,6 +172,9 @@ class SdlApp {
<< ", numFinder " << Event->mgesture.numFingers); << ", numFinder " << Event->mgesture.numFingers);
break; break;
} }
case WAGIC_UPDATE_EVENT:
OnUpdate();
break;
} }
} }
void OnUpdate(); void OnUpdate();
@@ -197,7 +210,9 @@ static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[]
{ SDLK_q, JGE_BTN_PREV }, { SDLK_q, JGE_BTN_PREV },
{ SDLK_a, JGE_BTN_NEXT }, { SDLK_a, JGE_BTN_NEXT },
{ SDLK_f, JGE_BTN_FULLSCREEN }, { SDLK_f, JGE_BTN_FULLSCREEN },
{ SDL_SCANCODE_AC_BACK, JGE_BTN_MENU }, { SDLK_AC_BACK, JGE_BTN_MENU },
{ SDLK_VOLUMEUP, JGE_BTN_PREV },
{ SDLK_VOLUMEDOWN, JGE_BTN_SEC},
}; };
void JGECreateDefaultBindings() void JGECreateDefaultBindings()
+1
View File
@@ -3,6 +3,7 @@
package="org.libsdl.app" package="org.libsdl.app"
android:versionCode="1" android:versionCode="1"
android:versionName="1.0"> android:versionName="1.0">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name="SDLActivity" <activity android:name="SDLActivity"
android:configChanges="orientation" android:configChanges="orientation"