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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 /** Presses or releases the specified (nonnegative) key. Called on the UI th read. */ |
290 public static boolean sendKeyEvent(int keyCode, boolean keyDown) { | 290 public static boolean sendKeyEvent(int scanCode, int keyCode, boolean keyDow n) { |
291 if (!sConnected) { | 291 if (!sConnected) { |
292 return false; | 292 return false; |
293 } | 293 } |
294 | 294 |
295 return nativeSendKeyEvent(keyCode, keyDown); | 295 return nativeSendKeyEvent(scanCode, keyCode, keyDown); |
296 } | 296 } |
297 | 297 |
298 /** Passes key press information to the native handling code. */ | 298 /** |
299 private static native boolean nativeSendKeyEvent(int keyCode, boolean keyDow n); | 299 * Passes key press information to the native handling code. If scanCode is zero then keyCode |
300 * is used, otherwise keyCode is ignored. */ | |
Lambros
2015/09/08 23:39:44
s/keyCode is ignored/scanCode is used/ ?
Maybe ad
Sergey Ulanov
2015/09/09 00:30:06
Done.
| |
301 private static native boolean nativeSendKeyEvent(int scanCode, int keyCode, boolean keyDown); | |
300 | 302 |
301 /** Sends TextEvent to the host. Called on the UI thread. */ | 303 /** Sends TextEvent to the host. Called on the UI thread. */ |
302 public static void sendTextEvent(String text) { | 304 public static void sendTextEvent(String text) { |
303 if (!sConnected) { | 305 if (!sConnected) { |
304 return; | 306 return; |
305 } | 307 } |
306 | 308 |
307 nativeSendTextEvent(text); | 309 nativeSendTextEvent(text); |
308 } | 310 } |
309 | 311 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 public static void sendExtensionMessage(String type, String data) { | 469 public static void sendExtensionMessage(String type, String data) { |
468 if (!sConnected) { | 470 if (!sConnected) { |
469 return; | 471 return; |
470 } | 472 } |
471 | 473 |
472 nativeSendExtensionMessage(type, data); | 474 nativeSendExtensionMessage(type, data); |
473 } | 475 } |
474 | 476 |
475 private static native void nativeSendExtensionMessage(String type, String da ta); | 477 private static native void nativeSendExtensionMessage(String type, String da ta); |
476 } | 478 } |
OLD | NEW |