| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chromoting; |
| 6 |
| 7 import org.chromium.chromoting.jni.TouchEventData; |
| 8 |
| 9 /** |
| 10 * A set of functions to send client users' activities to remote host machine. T
his interface |
| 11 * represents low level functions without relationships with Android system. Con
sumers can use |
| 12 * {@link InputEventSender} to avoid conversions between Android classes and JNI
types. The |
| 13 * implementations of this interface are not required to be thread-safe. All the
se functions should |
| 14 * be called from Android UI thread. |
| 15 */ |
| 16 public interface InputStub { |
| 17 // These constants must match those in the generated struct protocol::MouseE
vent_MouseButton. |
| 18 public static final int BUTTON_UNDEFINED = 0; |
| 19 public static final int BUTTON_LEFT = 1; |
| 20 public static final int BUTTON_MIDDLE = 2; |
| 21 public static final int BUTTON_RIGHT = 3; |
| 22 |
| 23 /** Sends a mouse event. */ |
| 24 void sendMouseEvent(int x, int y, int whichButton, boolean buttonDown); |
| 25 |
| 26 /** Sends a mouse wheel event. */ |
| 27 void sendMouseWheelEvent(int deltaX, int deltaY); |
| 28 |
| 29 /** |
| 30 * Sends a key event, and returns false if both scanCode and keyCode are not
able to be |
| 31 * converted to a known usb key code. Nothing will be sent to remote host, i
f this function |
| 32 * returns false. |
| 33 */ |
| 34 boolean sendKeyEvent(int scanCode, int keyCode, boolean keyDown); |
| 35 |
| 36 /** |
| 37 * Sends a string literal. This function is useful to handle outputs from An
droid input |
| 38 * methods. |
| 39 */ |
| 40 void sendTextEvent(String text); |
| 41 |
| 42 /** Sends a set of {@link TouchEventData}. */ |
| 43 void sendTouchEvent(TouchEventData.EventType eventType, TouchEventData[] dat
a); |
| 44 } |
| OLD | NEW |