summaryrefslogtreecommitdiffstats
path: root/remoting/proto/event.proto
diff options
context:
space:
mode:
authorweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-26 05:42:27 +0000
committerweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-26 05:42:27 +0000
commit5e3afcc870e2e18a79ad743aef08ba22bf5c4a4e (patch)
treee8067da873044ae21ac39389c439a4ae4ec69315 /remoting/proto/event.proto
parentee9b14ff102c0e24ab52dec9e40500c1f55a7dc8 (diff)
downloadchromium_src-5e3afcc870e2e18a79ad743aef08ba22bf5c4a4e.zip
chromium_src-5e3afcc870e2e18a79ad743aef08ba22bf5c4a4e.tar.gz
chromium_src-5e3afcc870e2e18a79ad743aef08ba22bf5c4a4e.tar.bz2
Chromoting: fixing caps lock issue with mac host.
The caps lock key doesn't work on a mac host: it doesn't toggle the caps lock state and the remote keyboard outputs upper or lower case letters depending on the caps lock state of the last local keyboard used. For example, if there are two local keyboards: keyboard 1 has caps lock on and keyboard 2 has caps lock off. If keyboard 1 was used last, the remote keyboard will output upper case letters; and if keyboard 2 was used last, lower case letters. Here are all the changes to fix the caps lock problem: 1. The KeyEvent proto buffer now contains a modifier_state field. 2. The client will set caps lock and num lock on the modifier_state field in the key event message appropriately. 3. The mac host now uses CGEventCreateKeyboardEvent/CGEventPost instead of the deprecated CGPostKeyBoardEvent to inject key events on a mac. 4. The mac host will set the caps lock flag with a key event if caps lock is on in the event message. 5. Update the unit tests for the key events. BUG=248275 Review URL: https://chromiumcodereview.appspot.com/16035018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208633 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/proto/event.proto')
-rw-r--r--remoting/proto/event.proto10
1 files changed, 10 insertions, 0 deletions
diff --git a/remoting/proto/event.proto b/remoting/proto/event.proto
index 4ba039a..e5ec135 100644
--- a/remoting/proto/event.proto
+++ b/remoting/proto/event.proto
@@ -12,6 +12,13 @@ package remoting.protocol;
// Defines a keyboard event.
message KeyEvent {
+
+ // The keyboard (Caps/Num) lock states.
+ enum LockStates {
+ LOCK_STATES_CAPSLOCK = 1;
+ LOCK_STATES_NUMLOCK = 2;
+ }
+
// The Windows Virtual Key code.
//optional int32 keycode = 1;
optional bool pressed = 2;
@@ -20,6 +27,9 @@ message KeyEvent {
// The upper 16-bits are the USB Page (0x07 for key events).
// The lower 16-bits are the USB Usage ID (which identifies the actual key).
optional uint32 usb_keycode = 3;
+
+ // The keyboard lock states.
+ optional uint32 lock_states = 4 [default = 0];
}
// Defines a mouse event message on the event channel.