OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Protocol for event messages. | 5 // Protocol for event messages. |
6 | 6 |
7 syntax = "proto2"; | 7 syntax = "proto2"; |
8 | 8 |
9 option optimize_for = LITE_RUNTIME; | 9 option optimize_for = LITE_RUNTIME; |
10 | 10 |
11 package remoting.protocol; | 11 package remoting.protocol; |
12 | 12 |
13 // Defines a keyboard event. | 13 // Defines a keyboard event. |
14 // NEXT ID: 3 | |
15 message KeyEvent { | 14 message KeyEvent { |
16 // The POSIX key code. | 15 // The POSIX key code. |
17 required int32 keycode = 1; | 16 required int32 keycode = 1; |
18 required bool pressed = 2; | 17 required bool pressed = 2; |
19 } | 18 } |
20 | 19 |
21 // Defines a mouse event message on the event channel. | 20 // Defines a mouse event message on the event channel. |
22 message MouseEvent { | 21 message MouseEvent { |
23 | 22 |
24 enum MouseButton { | 23 enum MouseButton { |
25 BUTTON_UNDEFINED = 0; | 24 BUTTON_UNDEFINED = 0; |
26 BUTTON_LEFT = 1; | 25 BUTTON_LEFT = 1; |
27 BUTTON_MIDDLE = 2; | 26 BUTTON_MIDDLE = 2; |
28 BUTTON_RIGHT = 3; | 27 BUTTON_RIGHT = 3; |
29 } | 28 } |
30 | 29 |
31 // Mouse position information. | 30 // Mouse position information. |
32 optional int32 x = 1; | 31 optional int32 x = 1; |
33 optional int32 y = 2; | 32 optional int32 y = 2; |
34 | 33 |
35 // Mouse wheel information. | 34 // Mouse wheel information. |
35 // In general, the |offset| values are the most useful, but the raw |clicks| | |
36 // value can be useful when cycling through a small set of items. | |
Jamie
2011/03/16 11:59:29
I don't understand what this comment means. How wo
garykac
2011/03/16 20:43:43
If you're doing scrolling, then you should use the
| |
37 // The number of pixels to scroll. | |
36 optional int32 wheel_offset_x = 3; | 38 optional int32 wheel_offset_x = 3; |
37 optional int32 wheel_offset_y = 4; | 39 optional int32 wheel_offset_y = 4; |
40 // The number of wheel clicks. | |
41 optional int32 wheel_clicks_x = 7; | |
42 optional int32 wheel_clicks_y = 8; | |
43 // True if |offset| values mean scroll by page (rather than by pixel or line). | |
Jamie
2011/03/16 11:59:29
Why do we have a bool to indicate scrolling by a p
garykac
2011/03/16 20:43:43
The pixel vs. line distinction is app-specific.
I
| |
44 optional bool wheel_by_page = 9; | |
38 | 45 |
39 // Mouse button event. | 46 // Mouse button event. |
40 optional MouseButton button = 5; | 47 optional MouseButton button = 5; |
41 optional bool button_down = 6; | 48 optional bool button_down = 6; |
42 } | 49 } |
OLD | NEW |