Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java

Issue 21120005: Add Android Chromoting client keyboard input (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing keymappings and default case for switch (findbugs-enforced) Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
index 0d7660bbd42e9e87b4f680c206af1c0f355269e6..55056180ffae5acdaeb40da7a0e96d137f6af9b0 100644
--- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
+++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java
@@ -179,7 +179,7 @@ public class JniInterface {
/** Forces the native graphics thread to redraw to the canvas. */
public static boolean redrawGraphics() {
synchronized(JniInterface.class) {
- if (!sConnected) return false;
+ if (!sConnected || sRedrawCallback == null) return false;
}
scheduleRedrawNative();
@@ -222,6 +222,15 @@ public class JniInterface {
mouseActionNative(x, y, whichButton, buttonDown);
}
+ /** Presses and releases the specified key. */
+ public static void keyboardAction(int keyCode, boolean keyDown) {
+ if (!sConnected) {
+ return;
+ }
+
+ keyboardActionNative(keyCode, keyDown);
+ }
+
/** Performs the native response to the user's PIN. */
private static native void authenticationResponse(String pin);
@@ -230,4 +239,7 @@ public class JniInterface {
/** Passes mouse information to the native handling code. */
private static native void mouseActionNative(int x, int y, int whichButton, boolean buttonDown);
+
+ /** Passes key press information to the native handling code. */
+ private static native void keyboardActionNative(int keyCode, boolean keyDown);
}

Powered by Google App Engine
This is Rietveld 408576698