summaryrefslogtreecommitdiffstats
path: root/remoting/proto/event.proto
blob: 5c774b5b1426a4ea1d39c9d0e2ff54e0fbbc1ceb (plain)
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
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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;
  }

  // The Windows Virtual Key code.
  //optional int32 keycode = 1;
  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;

  // The keyboard lock states.
  optional uint32 lock_states = 4 [default = 0];
}

// 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_MAX = 4;
  }

  // Mouse position information.
  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 when mouse lock is engaged.
  optional int32 delta_x = 11;
  optional int32 delta_y = 12;
}

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