summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2011-01-27 04:09:02 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2011-01-27 04:09:02 (GMT)
commit884278de9c26d441fb2371ac2fd1a4d343e77eec (patch)
tree9b220a0e417c1e7bca536d3839175dc36831ad9a
parent68a2fd655794e7c73b8c4b762951784a56972845 (diff)
downloadSoftKeys-884278de9c26d441fb2371ac2fd1a4d343e77eec.zip
SoftKeys-884278de9c26d441fb2371ac2fd1a4d343e77eec.tar.gz
SoftKeys-884278de9c26d441fb2371ac2fd1a4d343e77eec.tar.bz2
Add power/volume up/volume down keys to service and home screen, add
connect bot shortcuts
-rw-r--r--assets/input/RemoteContext.jarbin2547 -> 2563 bytes
-rw-r--r--res/layout/buttonids.xml5
-rw-r--r--res/values/arrays.xml16
-rw-r--r--res/values/strings.xml26
-rw-r--r--res/xml/prefs.xml72
-rw-r--r--src/net/hoopajoo/android/SoftKeys/ConfigureExtra.java59
-rw-r--r--src/net/hoopajoo/android/SoftKeys/Generator.java29
-rw-r--r--src/net/hoopajoo/android/SoftKeys/Globals.java23
-rw-r--r--src/net/hoopajoo/android/SoftKeys/Keys.java71
-rw-r--r--src/net/hoopajoo/android/SoftKeys/Prefs.java16
-rw-r--r--src/net/hoopajoo/android/SoftKeys/SoftKeysService.java91
11 files changed, 326 insertions, 82 deletions
diff --git a/assets/input/RemoteContext.jar b/assets/input/RemoteContext.jar
index 64b4764..90ad29a 100644
--- a/assets/input/RemoteContext.jar
+++ b/assets/input/RemoteContext.jar
Binary files differ
diff --git a/res/layout/buttonids.xml b/res/layout/buttonids.xml
index 6a06552..05bea58 100644
--- a/res/layout/buttonids.xml
+++ b/res/layout/buttonids.xml
@@ -29,6 +29,11 @@
<ImageButton android:id="@+id/search" />
<ImageButton android:id="@+id/settings" />
<ImageButton android:id="@+id/exit" />
+ <ImageButton android:id="@+id/sleep" />
+ <ImageButton android:id="@+id/volume_up" />
+ <ImageButton android:id="@+id/volume_down" />
+ <ImageButton android:id="@+id/custom1" />
+ <ImageButton android:id="@+id/custom2" />
<ImageButton android:id="@+id/popper" />
</LinearLayout>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 1d82e75..231e449 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -57,4 +57,20 @@
<item>tiny</item>
</string-array>
+ <string-array name="orientationNames">
+ <item>Horizontal, Adjustable</item>
+ <item>Horizontal, Locked</item>
+ <item>Vertical, Adjustable</item>
+ <item>Vertical, Locked</item>
+ <item>Last Orientation, Adjustable</item>
+ </string-array>
+
+ <string-array name="orientationValues">
+ <item>horizontal_adjust</item>
+ <item>horizontal</item>
+ <item>vertical_adjust</item>
+ <item>vertical</item>
+ <item>save_adjust</item>
+ </string-array>
+
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 412f8d2..dfea6a7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -31,6 +31,17 @@
<string name="pref_service_no_background_title">Transparent Background</string>
<string name="pref_service_no_background_summary_on">Background is Transparent, Buttons are Floating</string>
<string name="pref_service_no_background_summary_off">Normal Background Containing Buttons</string>
+ <string name="pref_service_orientation_title">Orientation</string>
+ <string name="pref_service_orientation_summary">Choose Vertical or Horizontal and if Long Press Toggles</string>
+
+ <string name="pref_category_custom_keys_title">Extra Custom Keys</string>
+ <string name="pref_category_custom_keys_summary">Set Custom Keys Under D-Pad</string>
+ <string name="pref_custom_key1">Custom Key 1</string>
+ <string name="pref_custom_key2">Custom Key 2</string>
+ <string name="pref_custom_key3">Custom Key 3</string>
+ <string name="pref_custom_key4">Custom Key 4</string>
+ <string name="pref_custom_key5">Custom Key 5</string>
+ <string name="pref_custom_key6">Custom Key 6</string>
<string name="pref_category_virtual_title">Virtual Home Button</string>
<string name="pref_category_virtual_summary">Select Launcher</string>
@@ -75,6 +86,21 @@
<string name="pref_choosebutton_title">Prefs Button</string>
<string name="pref_choosebutton_summary_on">Show Prefs Button</string>
<string name="pref_choosebutton_summary_off">Hide Prefs Button</string>
+ <string name="pref_volume_up_title">Volume Up Button</string>
+ <string name="pref_volume_up_summary_on">Show Volume Up Button</string>
+ <string name="pref_volume_up_summary_off">Hide Volume Up Button</string>
+ <string name="pref_volume_down_title">Volume Down Button</string>
+ <string name="pref_volume_down_summary_on">Show Volume Down Button</string>
+ <string name="pref_volume_down_summary_off">Hide Volume Down Button</string>
+ <string name="pref_sleep_title">Sleep Button</string>
+ <string name="pref_sleep_summary_on">Show Sleep Button</string>
+ <string name="pref_sleep_summary_off">Hide Sleep Button</string>
+ <string name="pref_extra_custom1_title">Custom 1 Button</string>
+ <string name="pref_extra_custom1_summary_on">Show Custom 1 Button</string>
+ <string name="pref_extra_custom1_summary_off">Hide Custom 1 Button</string>
+ <string name="pref_extra_custom2_title">Custom 2 Button</string>
+ <string name="pref_extra_custom2_summary_on">Show Custom 2 Button</string>
+ <string name="pref_extra_custom2_summary_off">Hide Custom 2 Button</string>
<string name="pref_screen_reorder_title">Change Button Order</string>
<string name="pref_order_menu_title">Menu Button Position</string>
diff --git a/res/xml/prefs.xml b/res/xml/prefs.xml
index 7a1b07b..fddc692 100644
--- a/res/xml/prefs.xml
+++ b/res/xml/prefs.xml
@@ -85,7 +85,51 @@
android:defaultValue="false"
android:key="service_no_background"
/>
-
+
+ <ListPreference
+ android:title="@string/pref_service_orientation_title"
+ android:summaryOn="@string/pref_service_orientation_summary"
+ android:entries="@array/orientationNames"
+ android:entryValues="@array/orientationValues"
+ android:defaultValue="save_adjust"
+ android:key="service_orientation"
+ />
+
+ <PreferenceScreen
+ android:title="@string/pref_category_custom_keys_title"
+ android:summary="@string/pref_category_custom_keys_summary">
+
+ <ListPreference
+ android:title="@string/pref_custom_key1"
+ android:key="service_extra_custom_keyid1"
+ />
+
+ <ListPreference
+ android:title="@string/pref_custom_key2"
+ android:key="service_extra_custom_keyid2"
+ />
+
+ <ListPreference
+ android:title="@string/pref_custom_key3"
+ android:key="service_extra_custom_keyid3"
+ />
+
+ <ListPreference
+ android:title="@string/pref_custom_key4"
+ android:key="service_extra_custom_keyid4"
+ />
+
+ <ListPreference
+ android:title="@string/pref_custom_key5"
+ android:key="service_extra_custom_keyid5"
+ />
+
+ <ListPreference
+ android:title="@string/pref_custom_key6"
+ android:key="service_extra_custom_keyid6"
+ />
+
+ </PreferenceScreen>
</PreferenceScreen>
<PreferenceScreen
@@ -189,8 +233,30 @@
android:key="choosebutton"
/>
-
-
+ <CheckBoxPreference
+ android:title="@string/pref_volume_up_title"
+ android:summaryOn="@string/pref_volume_up_summary_on"
+ android:summaryOff="@string/pref_volume_up_summary_off"
+ android:defaultValue="false"
+ android:key="show_volume_up"
+ />
+
+ <CheckBoxPreference
+ android:title="@string/pref_volume_down_title"
+ android:summaryOn="@string/pref_volume_down_summary_on"
+ android:summaryOff="@string/pref_volume_down_summary_off"
+ android:defaultValue="false"
+ android:key="show_volume_down"
+ />
+
+ <CheckBoxPreference
+ android:title="@string/pref_sleep_title"
+ android:summaryOn="@string/pref_sleep_summary_on"
+ android:summaryOff="@string/pref_sleep_summary_off"
+ android:defaultValue="false"
+ android:key="show_sleep"
+ />
+
<CheckBoxPreference
android:title="@string/pref_blur_behind_title"
android:summaryOn="@string/pref_blur_behind_summary_on"
diff --git a/src/net/hoopajoo/android/SoftKeys/ConfigureExtra.java b/src/net/hoopajoo/android/SoftKeys/ConfigureExtra.java
index 85bd35a..51f9fa6 100644
--- a/src/net/hoopajoo/android/SoftKeys/ConfigureExtra.java
+++ b/src/net/hoopajoo/android/SoftKeys/ConfigureExtra.java
@@ -44,7 +44,6 @@ import android.widget.Button;
import android.widget.Spinner;
public class ConfigureExtra extends Activity implements OnClickListener {
- /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -52,17 +51,7 @@ public class ConfigureExtra extends Activity implements OnClickListener {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences( this );
- List<CustomKey> items = new ArrayList<CustomKey>();
-
- items.add( new CustomKey( 0, "NONE" ) );
- items.add( new CustomKey( -1, "SLEEP" ) );
-
- for( int cnt = 1; cnt < 100; cnt++ ) {
- String name = K.keyIdToName( cnt );
- if( name != null ) {
- items.add( new CustomKey( cnt, name ) );
- }
- }
+ List<CustomKey> items = CustomKey.getCustomKeyList();
ArrayAdapter<CustomKey> adapter = new ArrayAdapter<CustomKey>( this, android.R.layout.simple_spinner_item, items );
@@ -73,8 +62,8 @@ public class ConfigureExtra extends Activity implements OnClickListener {
R.id.extra_custom5, R.id.extra_custom6
} ) {
i++;
- String pref_name = "service_extra_custom" + i + "_keyid";
- int keycode = settings.getInt( pref_name, 0 );
+ String pref_name = "service_extra_custom_keyid" + i;
+ int keycode = Integer.parseInt( settings.getString( pref_name, "0" ) );
Spinner s = (Spinner)findViewById( id );
s.setAdapter( adapter );
@@ -103,52 +92,14 @@ public class ConfigureExtra extends Activity implements OnClickListener {
R.id.extra_custom5, R.id.extra_custom6
} ) {
i++;
- String pref_name = "service_extra_custom" + i + "_keyid";
+ String pref_name = "service_extra_custom_keyid" + i;
Spinner s = (Spinner)findViewById( id );
CustomKey k = (CustomKey)s.getSelectedItem();
- e.putInt( pref_name, k.mId );
+ e.putString( pref_name, Integer.toString( k.mId ) );
}
e.commit();
((Globals)getApplication()).restartService();
}
this.finish();
}
-
- private class CustomKey {
- public String mName;
- public int mId;
-
- CustomKey( int id, String name ) {
- mName = prettyPrint( name );
- mId = id;
- }
-
- public String toString() {
- return mName;
- }
- }
-
- public static String prettyPrint( String n ) {
- // replace _ with space, initcap
- String s = n.replace( "_", " " );
-
- boolean bound = true;
- StringBuilder r = new StringBuilder();
- for( int i = 0; i < s.length(); i++ ) {
- if( bound ) {
- // cap
- r.append( Character.toUpperCase( s.charAt( i ) ) );
- bound = false;
- }else{
- r.append( Character.toLowerCase( s.charAt( i ) ) );
- }
-
- // check for boundry
- if( Character.isSpace( s.charAt( i ) ) ) {
- bound = true;
- }
- }
-
- return r.toString();
- }
}
diff --git a/src/net/hoopajoo/android/SoftKeys/Generator.java b/src/net/hoopajoo/android/SoftKeys/Generator.java
index 99ea772..715a104 100644
--- a/src/net/hoopajoo/android/SoftKeys/Generator.java
+++ b/src/net/hoopajoo/android/SoftKeys/Generator.java
@@ -98,8 +98,12 @@ public class Generator {
// now we add the buttons
if( buttons == null ) {
- buttons = new int[] { R.id.menu, R.id.home, R.id.back,
- R.id.search, R.id.settings, R.id.exit };
+ buttons = new int[] {
+ R.id.menu, R.id.home,
+ R.id.back, R.id.search,
+ R.id.volume_down, R.id.volume_up,
+ R.id.sleep,
+ R.id.settings, R.id.exit };
}
for( int i : buttons ) {
@@ -125,6 +129,26 @@ public class Generator {
name = "settings";
break;
+ case R.id.sleep:
+ name = "sleep";
+ break;
+
+ case R.id.volume_up:
+ name = "volume_up";
+ break;
+
+ case R.id.volume_down:
+ name = "volume_down";
+ break;
+
+ case R.id.custom1:
+ name = "custom1";
+ break;
+
+ case R.id.custom2:
+ name = "custom2";
+ break;
+
case R.id.exit:
name = "exit";
break;
@@ -161,7 +185,6 @@ public class Generator {
applyButtonExtras( b, prefix, name, theme, iconSize );
-
container.addView( orig_b );
}
diff --git a/src/net/hoopajoo/android/SoftKeys/Globals.java b/src/net/hoopajoo/android/SoftKeys/Globals.java
index 703b32c..31d3f95 100644
--- a/src/net/hoopajoo/android/SoftKeys/Globals.java
+++ b/src/net/hoopajoo/android/SoftKeys/Globals.java
@@ -92,7 +92,28 @@ public class Globals extends Application {
try {
Globals.RootContext cmd = getRootContext();
for( int id : keyids ) {
- cmd.runCommand( "keycode " + id );
+ if( id > 0 ) {
+ cmd.runCommand( "keycode " + id );
+ }else{
+ // special keys/commands
+ switch( id ) {
+ case -1:
+ cmd.runCommand( "sleep" );
+ break;
+
+ case -2:
+ // connectbot tab = dpad ball + i
+ cmd.runCommand( "keycode " + K.KEYID_DPAD_CENTER );
+ cmd.runCommand( "keycode " + K.KEYID_I );
+ break;
+
+ case -3:
+ // connectbot escape = dpad ball + dpad ball
+ cmd.runCommand( "keycode " + K.KEYID_DPAD_CENTER );
+ cmd.runCommand( "keycode " + K.KEYID_DPAD_CENTER );
+ break;
+ }
+ }
}
}catch( Exception e ) {
Log.e( LOG, "Error: " + e.getMessage() );
diff --git a/src/net/hoopajoo/android/SoftKeys/Keys.java b/src/net/hoopajoo/android/SoftKeys/Keys.java
index 9a28721..ddb87dc 100644
--- a/src/net/hoopajoo/android/SoftKeys/Keys.java
+++ b/src/net/hoopajoo/android/SoftKeys/Keys.java
@@ -122,8 +122,13 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen
// reorder the buttons, they will be in the order of the buttons[] array
// default is the order from my captivate:
// menu, home, back, search
- int[] buttons = { R.id.menu, R.id.home, R.id.back,
- R.id.search, R.id.settings, R.id.exit };
+ int[] buttons = {
+ R.id.menu, R.id.home,
+ R.id.back, R.id.search,
+ R.id.extra_custom1, R.id.extra_custom2,
+ R.id.volume_down, R.id.volume_up,
+ R.id.sleep,
+ R.id.settings, R.id.exit };
// now sort the buttons, we loop from 1 to 4, find the stuff with the same
// index as our index we're using, and add them to the list. This should pick
@@ -149,6 +154,11 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen
}
}
// now add choose and exit, always last
+ buttons[ button_index++ ] = R.id.extra_custom1;
+ buttons[ button_index++ ] = R.id.extra_custom2;
+ buttons[ button_index++ ] = R.id.volume_down;
+ buttons[ button_index++ ] = R.id.volume_up;
+ buttons[ button_index++ ] = R.id.sleep;
buttons[ button_index++ ] = R.id.settings;
buttons[ button_index++ ] = R.id.exit;
@@ -169,11 +179,46 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen
b.setVisibility(
settings.getBoolean( "exitbutton", true ) ? View.VISIBLE : View.GONE );
}
-
- if( i == R.id.settings ) {
- b.setVisibility(
- settings.getBoolean( "choosebutton", true ) ? View.VISIBLE : View.GONE );
- }
+ }
+
+ String pref = null;
+ boolean def = false;
+
+ switch( i ) {
+ case R.id.settings:
+ pref = "choosebutton";
+ def = true;
+ break;
+
+ case R.id.extra_custom1:
+ pref = "show_extra_custom1";
+ def = false;
+ break;
+
+ case R.id.extra_custom2:
+ pref = "show_extra_custom2";
+ def = false;
+ break;
+
+ case R.id.volume_down:
+ pref = "show_volume_down";
+ def = false;
+ break;
+
+ case R.id.volume_up:
+ pref = "show_volume_up";
+ def = false;
+ break;
+
+ case R.id.sleep:
+ pref = "show_sleep";
+ def = false;
+ break;
+ }
+
+ if( pref != null ) {
+ b.setVisibility(
+ settings.getBoolean( pref, def ) ? View.VISIBLE : View.GONE );
}
}
}
@@ -574,6 +619,18 @@ public class Keys extends Activity implements OnClickListener, OnLongClickListen
this.finish();
return true;
+ case R.id.volume_down:
+ keyids.add( K.KEYID_VOLUME_DOWN );
+ break;
+
+ case R.id.volume_up:
+ keyids.add( K.KEYID_VOLUME_UP );
+ break;
+
+ case R.id.sleep:
+ keyids.add( -1 );
+ break;
+
default:
d( "Unknown click event: " + id );
return true;
diff --git a/src/net/hoopajoo/android/SoftKeys/Prefs.java b/src/net/hoopajoo/android/SoftKeys/Prefs.java
index 4a93b15..e24cb3c 100644
--- a/src/net/hoopajoo/android/SoftKeys/Prefs.java
+++ b/src/net/hoopajoo/android/SoftKeys/Prefs.java
@@ -49,6 +49,22 @@ public class Prefs extends PreferenceActivity {
i = new Intent( "net.hoopajoo.android.SoftKeys.THEMES" );
i.addCategory( Intent.CATEGORY_DEFAULT );
fillListFromIntent( (ListPreference)findPreference( "theme" ), i, "Default", "" );
+
+ // add the custom keys here too
+ ArrayList<String> display = new ArrayList<String>();
+ ArrayList<String> values = new ArrayList<String>();
+
+ for( CustomKey k : CustomKey.getCustomKeyList() ) {
+ display.add( k.mName );
+ values.add( Integer.toString( k.mId ) );
+ }
+
+ for( int num = 0; num < 5; num++ ) {
+ String s = "service_extra_custom_keyid" + (num + 1);
+ ListPreference list = (ListPreference)findPreference( s );
+ list.setEntries( display.toArray( new CharSequence[ display.size() ] ) );
+ list.setEntryValues( values.toArray( new CharSequence[ values.size() ] ) );
+ }
String ver = "unknown";
try {
diff --git a/src/net/hoopajoo/android/SoftKeys/SoftKeysService.java b/src/net/hoopajoo/android/SoftKeys/SoftKeysService.java
index 9371814..e75cbf5 100644
--- a/src/net/hoopajoo/android/SoftKeys/SoftKeysService.java
+++ b/src/net/hoopajoo/android/SoftKeys/SoftKeysService.java
@@ -64,6 +64,8 @@ public class SoftKeysService extends Service {
private View mBumpView;
private boolean auto_hide;
private boolean auto_hide_after_back;
+ private boolean mOrientationAdjustable = true;
+ private boolean mRestoreOrientation = true;
private boolean mDraggingView;
private View mDraggingViewObj;
private int mDraggingOrigX, mDraggingOrigY;
@@ -117,12 +119,14 @@ public class SoftKeysService extends Service {
return false;
}
- // rotate
- LinearLayout l = (LinearLayout)mView.findViewById( R.id.button_container );
- if( l.getOrientation() == LinearLayout.HORIZONTAL ) {
- l.setOrientation( LinearLayout.VERTICAL );
- }else{
- l.setOrientation( LinearLayout.HORIZONTAL );
+ if( mOrientationAdjustable ) {
+ // rotate
+ LinearLayout l = (LinearLayout)mView.findViewById( R.id.button_container );
+ if( l.getOrientation() == LinearLayout.HORIZONTAL ) {
+ l.setOrientation( LinearLayout.VERTICAL );
+ }else{
+ l.setOrientation( LinearLayout.HORIZONTAL );
+ }
}
savePosition();
@@ -428,21 +432,24 @@ public class SoftKeysService extends Service {
R.id.extra_custom5, R.id.extra_custom6
} ) {
i++;
- String pref_name = "service_extra_custom" + i + "_keyid";
- int keycode = settings.getInt( pref_name, 0 );
+ String pref_name = "service_extra_custom_keyid" + i;
+ int keycode = Integer.parseInt( settings.getString( pref_name, "0" ) );
String keyname = K.keyIdToName( keycode );
if( keycode > 0 ) {
if( keyname == null ) {
keyname = "NONE";
}else{
- keyname = ConfigureExtra.prettyPrint( keyname );
+ keyname = CustomKey.prettyPrint( keyname );
}
}else{
if( keycode == 0 ) {
keyname = "NONE";
- }
- if( keycode == -1 ) {
+ }else if( keycode == -1 ) {
keyname = "SLEEP";
+ }else if( keycode == -2 ) {
+ keyname = "CB: TAB";
+ }else if( keycode == -3 ) {
+ keyname = "CB: ESCAPE";
}
}
@@ -464,6 +471,25 @@ public class SoftKeysService extends Service {
wm.addView( mView, makeOverlayParams() );
wm.addView( mExtraView, makeOverlayParams() );
+ // initialize preference orientation
+ LinearLayout ll = (LinearLayout)mView.findViewById( R.id.button_container );
+ String orientation = settings.getString( "service_orientation", "horizontal_adjust" );
+ if( orientation.contains( "adjust" ) ) {
+ mOrientationAdjustable = true;
+ }else{
+ mOrientationAdjustable = false;
+ }
+
+ mRestoreOrientation = false;
+ if( orientation.contains( "save" ) ) {
+ // init to last saved value
+ mRestoreOrientation = true;
+ }else if( orientation.contains( "horizontal" ) ) {
+ ll.setOrientation( LinearLayout.HORIZONTAL );
+ }else{
+ ll.setOrientation( LinearLayout.VERTICAL );
+ }
+
mOrientationListener = new OrientationEventListener( this, SensorManager.SENSOR_DELAY_NORMAL ) {
@Override
public void onOrientationChanged( int orientation ) {
@@ -522,6 +548,16 @@ public class SoftKeysService extends Service {
params.y = settings.getInt( "service_extra_last_y_" + mOrientation, 0 );
params.gravity = Gravity.TOP | Gravity.LEFT;
wm.updateViewLayout( mExtraView, params );
+
+ if( mRestoreOrientation ) {
+ String last_orientation = settings.getString( "service_last_orientation_" + mOrientation, "horizontal" );
+ LinearLayout l = (LinearLayout)mView.findViewById( R.id.button_container );
+ if( last_orientation.equals( "vertical" ) ) {
+ l.setOrientation( LinearLayout.VERTICAL );
+ }else{
+ l.setOrientation( LinearLayout.HORIZONTAL );
+ }
+ }
}
private boolean genericClick( View v, boolean longClick ) {
@@ -565,6 +601,18 @@ public class SoftKeysService extends Service {
}
break;
+ case R.id.sleep:
+ keyid = -1;
+ break;
+
+ case R.id.volume_down:
+ keyid = K.KEYID_VOLUME_DOWN;
+ break;
+
+ case R.id.volume_up:
+ keyid = K.KEYID_VOLUME_UP;
+ break;
+
case R.id.exit:
hide = true;
break;
@@ -627,11 +675,19 @@ public class SoftKeysService extends Service {
}
if( keyid != 0 ) {
- if( keyid == -1 ) {
- // sleep
+ if( false && keyid < 0 ) {
+ // dead, move special keys up to globals
+ String[] cmds = new String[] {};
+ if( keyid == -1 ) {
+ // sleep
+ cmds = new String[] { "sleep" };
+ }
+
try {
Globals.RootContext cmd = ((Globals)getApplication()).getRootContext();
- cmd.runCommand( "sleep" );
+ for( String command : cmds ) {
+ cmd.runCommand( command );
+ }
}catch( Exception e ) {
// we don't really care if this fails, they should have gotten a shell
// error from the sendkeys
@@ -751,6 +807,13 @@ public class SoftKeysService extends Service {
e.putBoolean( "service_extra_enabled", mExtraEnabled );
+ LinearLayout ll = (LinearLayout)mView.findViewById( R.id.button_container );
+ String orientation = "horizontal";
+ if( ll.getOrientation() == LinearLayout.VERTICAL ) {
+ orientation = "vertical";
+ }
+ e.putString( "service_last_orientation_" + mOrientation, orientation );
+
e.commit();
}