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

Unified Diff: remoting/client/jni/chromoting_jni_instance.cc

Issue 1321223003: Use scan codes when sending keyboard events froms physical keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9c0fae7eb0872fd730e9d6d267a85d6e8d76dd6d..62c4edf7c7330fcfd7f07b578116f23b1368a966 100644
--- a/remoting/client/jni/chromoting_jni_instance.cc
+++ b/remoting/client/jni/chromoting_jni_instance.cc
@@ -25,6 +25,7 @@
#include "remoting/protocol/negotiating_client_authenticator.h"
#include "remoting/protocol/network_settings.h"
#include "remoting/signaling/server_log_entry.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
namespace remoting {
@@ -229,10 +230,17 @@ void ChromotingJniInstance::SendMouseWheelEvent(int delta_x, int delta_y) {
client_->input_stub()->InjectMouseEvent(event);
}
-bool ChromotingJniInstance::SendKeyEvent(int key_code, bool key_down) {
- uint32 usb_key_code = AndroidKeycodeToUsbKeycode(key_code);
+bool ChromotingJniInstance::SendKeyEvent(int scan_code,
+ int key_code,
+ bool key_down) {
+ // For software keyboards |scan_code| is set to 0, in which case the
+ // |key_code| is used instead.
+ uint32_t usb_key_code =
+ scan_code ? ui::KeycodeConverter::NativeKeycodeToUsbKeycode(scan_code)
+ : AndroidKeycodeToUsbKeycode(key_code);
if (!usb_key_code) {
- LOG(WARNING) << "Ignoring unknown keycode: " << key_code;
+ LOG(WARNING) << "Ignoring unknown key code: " << key_code
+ << " scan code: " << scan_code;
return false;
}
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698