Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/InputInjector.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/InputInjector.java b/remoting/android/java/src/org/chromium/chromoting/InputInjector.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ddd39692b712f4dbcc3450352b9d99ea0fd49fc5 |
| --- /dev/null |
| +++ b/remoting/android/java/src/org/chromium/chromoting/InputInjector.java |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chromoting; |
| + |
| +import org.chromium.chromoting.jni.TouchEventData; |
| + |
| +/** |
| + * A set of functions to send client users' activities to remote host machine. This interface |
| + * represents low level functions without relationships with Android system. Consumers can use |
| + * {@link InputInjectorWrapper} to avoid conversions between Android classes and JNI types. The |
| + * implementations of this interface are not required to be thread-safe. All these functions should |
| + * be called from Android UI thread. |
| + */ |
| +public interface InputInjector { |
| + /** Sends a mouse event. */ |
| + void sendMouseEvent(int x, int y, int whichButton, boolean buttonDown); |
| + /** Sends a mouse wheel event. */ |
|
Lambros
2016/06/17 23:00:09
Blank lines before comments please (here and elsew
Hzj_jie
2016/06/19 23:41:38
Done.
|
| + void sendMouseWheelEvent(int deltaX, int deltaY); |
| + /** |
| + * Sends a key event, and returns false if both scanCode and keyCode are not able to be |
| + * converted to a known usb key code. Nothing will be sent to remote host, if this function |
| + * returns false. |
| + */ |
| + boolean sendKeyEvent(int scanCode, int keyCode, boolean keyDown); |
| + /** |
| + * Sends a string literal. This function is useful to handle outputs from Android input |
| + * methods. |
| + */ |
| + void sendTextEvent(String text); |
| + /** Sends a set of {@link TouchEventData}. */ |
| + void sendTouchEvent(TouchEventData.EventType eventType, TouchEventData[] data); |
| +} |