summaryrefslogtreecommitdiffstats
path: root/src/net/hoopajoo/android/SoftKeys/SendInput.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/hoopajoo/android/SoftKeys/SendInput.java')
-rw-r--r--src/net/hoopajoo/android/SoftKeys/SendInput.java19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/net/hoopajoo/android/SoftKeys/SendInput.java b/src/net/hoopajoo/android/SoftKeys/SendInput.java
index 9e962ad..aa30d62 100644
--- a/src/net/hoopajoo/android/SoftKeys/SendInput.java
+++ b/src/net/hoopajoo/android/SoftKeys/SendInput.java
@@ -61,16 +61,6 @@ import android.widget.Toast;
public class SendInput extends Activity {
public static String ACTION_CODE = "net.hoopajoo.android.SoftKeys.KEY_CODE";
- private static final Map<String,Integer> mKeymap;
- static {
- Map<String,Integer> t = new HashMap<String,Integer>();
- t.put( "back", 4 );
- t.put( "menu", 82 );
- t.put( "search", 84 );
- mKeymap = Collections.unmodifiableMap( t );
- }
-
-
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -95,15 +85,16 @@ public class SendInput extends Activity {
return;
}else{
// run through resolver
- if( mKeymap.containsKey( key ) ) {
- keyid = mKeymap.get( key );
- }
+ keyid = K.keyNameToId( key );
}
}else if( e.getInt( "keyid", 0 ) != 0 ) {
keyid = e.getInt( "keyid", 0 );
}
+
+ if( keyid != 0 ) {
+ ((Globals)getApplication()).sendKeys( new int[] { keyid } );
+ }
- ((Globals)getApplication()).sendKeys( new int[] { keyid } );
// todo: make me a broadcast receiver.. or maybe this should be removed all together?
// any good reasons to allow other apps to call hw keys?
this.finish();