| Index: remoting/client/jni/chromoting_jni_instance.cc
|
| diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc
|
| index ecf8632787543632105a3b295d526ebd93e552c9..dcec68fcaadc559336627485d9fda1acba48ff18 100644
|
| --- a/remoting/client/jni/chromoting_jni_instance.cc
|
| +++ b/remoting/client/jni/chromoting_jni_instance.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "remoting/client/audio_player.h"
|
| +#include "remoting/client/jni/android_keymap.h"
|
| #include "remoting/client/jni/chromoting_jni_runtime.h"
|
| #include "remoting/protocol/libjingle_transport_factory.h"
|
|
|
| @@ -105,6 +106,28 @@ void ChromotingJniInstance::PerformMouseAction(
|
| connection_->input_stub()->InjectMouseEvent(action);
|
| }
|
|
|
| +void ChromotingJniInstance::PerformKeyboardAction(int keyCode, bool keyDown) {
|
| + if (!jni_runtime_->network_task_runner()->BelongsToCurrentThread()) {
|
| + jni_runtime_->network_task_runner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&ChromotingJniInstance::PerformKeyboardAction,
|
| + this,
|
| + keyCode,
|
| + keyDown));
|
| + return;
|
| + }
|
| +
|
| + uint32 usbCode = AndroidKeycodeToUsbKeycode(keyCode);
|
| + if (usbCode) {
|
| + protocol::KeyEvent action;
|
| + action.set_usb_keycode(usbCode);
|
| + action.set_pressed(keyDown);
|
| + connection_->input_stub()->InjectKeyEvent(action);
|
| + }
|
| + else
|
| + LOG(WARNING) << "Ignoring unknown keycode: " << keyCode;
|
| +}
|
| +
|
| void ChromotingJniInstance::OnConnectionState(
|
| protocol::ConnectionToHost::State state,
|
| protocol::ErrorCode error) {
|
|
|