summaryrefslogtreecommitdiffstats
path: root/cmds/input
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-04-29 15:29:13 -0700
committerJeff Sharkey <jsharkey@android.com>2013-04-29 15:29:13 -0700
commitf1301d86fb7f414330b08dd9514436e65ba69ceb (patch)
treeb0a1944d373ec02db2c33e45008da173138fb8a5 /cmds/input
parentb98212925e41e9420ce6fefc3fe204b29c8f7a83 (diff)
parentb3f6687756ffb660f834ef673bed04b2d4a26d21 (diff)
downloadframeworks_base-f1301d86fb7f414330b08dd9514436e65ba69ceb.zip
frameworks_base-f1301d86fb7f414330b08dd9514436e65ba69ceb.tar.gz
frameworks_base-f1301d86fb7f414330b08dd9514436e65ba69ceb.tar.bz2
Merge commit 'b3f66877' into afdmerge
Change-Id: I319863cf23b2e6eacfa4508f7b111fba7b1cbc24
Diffstat (limited to 'cmds/input')
-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 e43501c..80ac539 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")) {
@@ -237,7 +239,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);
}
@@ -249,7 +251,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|touchnavigation] tap <x> <y>");
System.err.println(" input [touchscreen|touchpad|touchnavigation] swipe "
+ "<x1> <y1> <x2> <y2> [duration(ms)]");