From f2bcf09b267a0a0b7af237a23e57b09249686c2a Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Wed, 25 Dec 2013 20:35:31 +0200 Subject: [PATCH] Orientation now can be reverse landscape, small fix to keymap --- changeAppSettings.sh | 4 ++-- project/AndroidManifestTemplate.xml | 2 +- project/java/MainActivity.java | 7 ++++++- project/jni/application/hid-pc-keyboard/src | 2 +- project/jni/sdl-1.2/src/video/android/keymap.c | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/changeAppSettings.sh b/changeAppSettings.sh index 476e10267..868662ab7 100755 --- a/changeAppSettings.sh +++ b/changeAppSettings.sh @@ -1011,7 +1011,7 @@ AppShortName=`echo $AppName | sed 's/ //g'` DataPath="$AppFullName" AppFullNameUnderscored=`echo $AppFullName | sed 's/[.]/_/g'` AppSharedLibrariesPath=/data/data/$AppFullName/lib -ScreenOrientation1=portrait +ScreenOrientation1=userPortrait HorizontalOrientation=false UsingSdl13=false @@ -1025,7 +1025,7 @@ if [ "$LibSdlVersion" = "2.0" ] ; then fi if [ "$ScreenOrientation" = "h" -o "$ScreenOrientation" = "l" ] ; then - ScreenOrientation1=landscape + ScreenOrientation1=userLandscape HorizontalOrientation=true fi diff --git a/project/AndroidManifestTemplate.xml b/project/AndroidManifestTemplate.xml index 18b090c27..17082c894 100644 --- a/project/AndroidManifestTemplate.xml +++ b/project/AndroidManifestTemplate.xml @@ -13,7 +13,7 @@ android:label="@string/app_name" android:alwaysRetainTaskState="true" android:launchMode="singleTask" - android:screenOrientation="landscape" + android:screenOrientation="userLandscape" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode|screenSize|smallestScreenSize" android:windowSoftInputMode="stateUnspecified|adjustPan" > diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index b688f62ee..4920cdf10 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -85,7 +85,12 @@ public class MainActivity extends Activity { super.onCreate(savedInstanceState); - setRequestedOrientation(Globals.HorizontalOrientation ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2 ) + setRequestedOrientation(Globals.HorizontalOrientation ? ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT); + else if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD ) + setRequestedOrientation(Globals.HorizontalOrientation ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); + else + setRequestedOrientation(Globals.HorizontalOrientation ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); instance = this; // fullscreen mode diff --git a/project/jni/application/hid-pc-keyboard/src b/project/jni/application/hid-pc-keyboard/src index e9b01beb1..cbbab1c8d 160000 --- a/project/jni/application/hid-pc-keyboard/src +++ b/project/jni/application/hid-pc-keyboard/src @@ -1 +1 @@ -Subproject commit e9b01beb1a0b421b2cb5ac6501d56ea54f0ef2bd +Subproject commit cbbab1c8d6baf70ea9df0f81bac11e7be814e801 diff --git a/project/jni/sdl-1.2/src/video/android/keymap.c b/project/jni/sdl-1.2/src/video/android/keymap.c index a96b3366c..650834450 100644 --- a/project/jni/sdl-1.2/src/video/android/keymap.c +++ b/project/jni/sdl-1.2/src/video/android/keymap.c @@ -154,7 +154,7 @@ void SDL_android_init_keymap(SDLKey *SDL_android_keymap) keymap[KEYCODE_META_LEFT] = SDL_KEY(LGUI); keymap[KEYCODE_META_RIGHT] = SDL_KEY(RGUI); keymap[KEYCODE_FUNCTION] = SDL_KEY(RGUI); - keymap[KEYCODE_SYSRQ] = SDL_KEY(SYSREQ); + keymap[KEYCODE_SYSRQ] = SDL_KEY(PRINT); keymap[KEYCODE_BREAK] = SDL_KEY(PAUSE); keymap[KEYCODE_MOVE_HOME] = SDL_KEY(HOME); keymap[KEYCODE_MOVE_END] = SDL_KEY(END);