summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@android.com>2013-04-29 22:05:43 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-04-29 22:05:44 +0000
commitb3f6687756ffb660f834ef673bed04b2d4a26d21 (patch)
treeee0f4a0b48a193a4e9d26ede2a0297a53f90cfc6
parentbd1730dec7356e042ee885ff4a63b40f36733062 (diff)
parent2ac9d8d0f0ea65aae6ba43490b5be6617ad97125 (diff)
downloadframeworks_base-b3f6687756ffb660f834ef673bed04b2d4a26d21.zip
frameworks_base-b3f6687756ffb660f834ef673bed04b2d4a26d21.tar.gz
frameworks_base-b3f6687756ffb660f834ef673bed04b2d4a26d21.tar.bz2
Merge "input: added support for multiple keyevents"
-rw-r--r--cmds/input/src/com/android/commands/input/Input.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/cmds/input/src/com/android/commands/input/Input.java b/cmds/input/src/com/android/commands/input/Input.java
index a21df0d..6dc9f3d 100644
--- a/cmds/input/src/com/android/commands/input/Input.java
+++ b/cmds/input/src/com/android/commands/input/Input.java
@@ -56,12 +56,14 @@ public class Input {
return;
}
} else if (command.equals("keyevent")) {
- if (args.length == 2) {
- int keyCode = KeyEvent.keyCodeFromString(args[1]);
- if (keyCode == KeyEvent.KEYCODE_UNKNOWN) {
- keyCode = KeyEvent.keyCodeFromString("KEYCODE_" + args[1]);
+ if (args.length >= 2) {
+ for (int i=1; i < args.length; i++) {
+ int keyCode = KeyEvent.keyCodeFromString(args[i]);
+ if (keyCode == KeyEvent.KEYCODE_UNKNOWN) {
+ keyCode = KeyEvent.keyCodeFromString("KEYCODE_" + args[i]);
+ }
+ sendKeyEvent(keyCode);
}
- sendKeyEvent(keyCode);
return;
}
} else if (command.equals("tap")) {
@@ -223,7 +225,7 @@ public class Input {
DEFAULT_META_STATE, DEFAULT_PRECISION_X, DEFAULT_PRECISION_Y, DEFAULT_DEVICE_ID,
DEFAULT_EDGE_FLAGS);
event.setSource(inputSource);
- Log.i("Input", "injectMotionEvent: " + event);
+ Log.i(TAG, "injectMotionEvent: " + event);
InputManager.getInstance().injectInputEvent(event,
InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH);
}
@@ -235,7 +237,7 @@ public class Input {
private void showUsage() {
System.err.println("usage: input ...");
System.err.println(" input text <string>");
- System.err.println(" input keyevent <key code number or name>");
+ System.err.println(" input keyevent <key code number or name> ...");
System.err.println(" input [touchscreen|touchpad] tap <x> <y>");
System.err.println(" input [touchscreen|touchpad] swipe <x1> <y1> <x2> <y2>");
System.err.println(" input trackball press");