File: event.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (162 lines) | stat: -rw-r--r-- 5,379 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Protocol for event messages.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

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;
  }

  // True for key press events, and false for key release.
  optional bool pressed = 2;

  // The USB key code.
  // 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;

  // Legacy keyboard lock states. Prefer the discrete entries below.
  optional uint32 lock_states = 4 [default = 0];

  // Keyboard lock states. The field should be specified only if the state can
  // be reliably determined by the client. E.g., OS X does not have num lock, so
  // only caps_lock should be provided by a client running on OS X.
  optional bool caps_lock_state = 5;
  optional bool num_lock_state = 6;
}

// Text input event for input method different from physical keyboards,
// including software keyboard, gesture typing, voice input, etc.
message TextEvent {
  // Unicode sequence for the event in UTF-8.
  optional string text = 1;
}

// Fractional coordinate information. Fractional coordinates define a location
// as a number in the range [0, 1], interpreted relative to the bounds of a
// monitor identified by |stream_id| in the most recent VideoLayout message sent
// by the host.
message FractionalCoordinate {
  optional float x = 1;
  optional float y = 2;
  optional int64 screen_id = 3;
}

// Defines a mouse event message on the event channel.
message MouseEvent {

  enum MouseButton {
    BUTTON_UNDEFINED = 0;
    BUTTON_LEFT = 1;
    BUTTON_MIDDLE = 2;
    BUTTON_RIGHT = 3;
    BUTTON_BACK = 4;
    BUTTON_FORWARD = 5;
    BUTTON_MAX = 6;
  }

  // Mouse absolute position information. When using WebRTC-based protocol the
  // coordinates are in DIPs. Otherwise they are in host's physical pixels. In
  // both coordinates systems, the top-left monitor on the system always starts
  // from (0, 0).
  optional int32 x = 1;
  optional int32 y = 2;

  // Mouse button event.
  optional MouseButton button = 5;
  optional bool button_down = 6;

  // Mouse wheel information.
  // These values encode the number of pixels and 'ticks' of movement that
  // would result from the wheel event on the client system.
  optional float wheel_delta_x = 7;
  optional float wheel_delta_y = 8;
  optional float wheel_ticks_x = 9;
  optional float wheel_ticks_y = 10;

  // Mouse movement information. Provided only for relative mouse events (i.e.
  // when mouse lock is engaged).
  optional int32 delta_x = 11;
  optional int32 delta_y = 12;

  // Fractional coordinate information. Provided only for absolute mouse events
  // (i.e. when mouse lock is *not* engaged).
  optional FractionalCoordinate fractional_coordinate = 13;
}

// Defines an event that sends clipboard data between peers.
message ClipboardEvent {

  // The MIME type of the data being sent.
  optional string mime_type = 1;

  // The data being sent.
  optional bytes data = 2;
}

message TouchEventPoint {
  // The ID for the touch point.
  optional uint32 id = 1;

  // The absolute position of the touch point. These values on-the-wire are host
  // physical pixel coordinates: the top-left monitor on the system always
  // starts from (0, 0).
  optional float x = 2;
  optional float y = 3;

  // The size of the touch point, used to aid hit-testing.
  // Scaled to match the size on host.
  optional float radius_x = 4;
  optional float radius_y = 5;

  // Angle in degrees from the y-axis of the touch point.
  optional float angle = 6;

  // The pressure of the touch point.
  // The value should be in [0.0, 1.0].
  optional float pressure = 7;

  optional FractionalCoordinate fractional_coordinate = 8;
}

message TouchEvent {
  // A START event means that this event reports all the touch points that were
  // just added, e.g. a finger started touching the display.
  // A MOVE event means that the touch points that have been STARTed moved,
  // e.g. multiple fingers on the screen moved.
  // An END event means that the touch points that have been STARTed ended.
  // e.g. a finger went off the screen.
  // A CANCEL event means that the touch points that have been STARTed were
  // canceled, e.g. a finger went off the screen.
  // Cancel event is simlar to END but slighly different. For example, Android
  // MotionEvent's ACTION_CANCEL documentation mentions that a cancel should be
  // treated as an ACTION_UP (END) event but might not perform the exact same
  // actions as a normal ACTION_UP event.
  enum TouchEventType {
    TOUCH_POINT_UNDEFINED = 0;
    TOUCH_POINT_START = 1;
    TOUCH_POINT_MOVE = 2;
    TOUCH_POINT_END = 3;
    TOUCH_POINT_CANCEL = 4;
  };

  optional TouchEventType event_type = 1;

  // Only the changed touch points are added to this field.
  // Given the existing touch point APIs (e.g. Android and PPAPI)
  // for START, END, and CANCEL events the size of this field will typically be
  // 1, but for MOVE events it is likely to have multiple points.
  repeated TouchEventPoint touch_points = 2;
}