OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chromoting.jni; | 5 package org.chromium.chromoting.jni; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
9 import android.graphics.Point; | 9 import android.graphics.Point; |
10 import android.os.Looper; | 10 import android.os.Looper; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (!sConnected) { | 279 if (!sConnected) { |
280 return; | 280 return; |
281 } | 281 } |
282 | 282 |
283 nativeSendMouseWheelEvent(deltaX, deltaY); | 283 nativeSendMouseWheelEvent(deltaX, deltaY); |
284 } | 284 } |
285 | 285 |
286 /** Passes mouse-wheel information to the native handling code. */ | 286 /** Passes mouse-wheel information to the native handling code. */ |
287 private static native void nativeSendMouseWheelEvent(int deltaX, int deltaY)
; | 287 private static native void nativeSendMouseWheelEvent(int deltaX, int deltaY)
; |
288 | 288 |
289 /** Presses or releases the specified (nonnegative) key. Called on the UI th
read. */ | 289 /** |
290 public static boolean sendKeyEvent(int keyCode, boolean keyDown) { | 290 * Presses or releases the specified (nonnegative) key. Called on the UI thr
ead. If scanCode |
| 291 * is not zero then keyCode is ignored. |
| 292 */ |
| 293 public static boolean sendKeyEvent(int scanCode, int keyCode, boolean keyDow
n) { |
291 if (!sConnected) { | 294 if (!sConnected) { |
292 return false; | 295 return false; |
293 } | 296 } |
294 | 297 |
295 return nativeSendKeyEvent(keyCode, keyDown); | 298 return nativeSendKeyEvent(scanCode, keyCode, keyDown); |
296 } | 299 } |
297 | 300 |
298 /** Passes key press information to the native handling code. */ | 301 /** |
299 private static native boolean nativeSendKeyEvent(int keyCode, boolean keyDow
n); | 302 * Passes key press information to the native handling code. |
| 303 */ |
| 304 private static native boolean nativeSendKeyEvent(int scanCode, int keyCode,
boolean keyDown); |
300 | 305 |
301 /** Sends TextEvent to the host. Called on the UI thread. */ | 306 /** Sends TextEvent to the host. Called on the UI thread. */ |
302 public static void sendTextEvent(String text) { | 307 public static void sendTextEvent(String text) { |
303 if (!sConnected) { | 308 if (!sConnected) { |
304 return; | 309 return; |
305 } | 310 } |
306 | 311 |
307 nativeSendTextEvent(text); | 312 nativeSendTextEvent(text); |
308 } | 313 } |
309 | 314 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 public static void sendExtensionMessage(String type, String data) { | 472 public static void sendExtensionMessage(String type, String data) { |
468 if (!sConnected) { | 473 if (!sConnected) { |
469 return; | 474 return; |
470 } | 475 } |
471 | 476 |
472 nativeSendExtensionMessage(type, data); | 477 nativeSendExtensionMessage(type, data); |
473 } | 478 } |
474 | 479 |
475 private static native void nativeSendExtensionMessage(String type, String da
ta); | 480 private static native void nativeSendExtensionMessage(String type, String da
ta); |
476 } | 481 } |
OLD | NEW |