1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Protocol for event messages. 6 7 syntax = "proto2"; 8 9 option optimize_for = LITE_RUNTIME; 10 11 package remoting.protocol; 12 13 // Defines a keyboard event. 14 message KeyEvent { 15 16 // The keyboard (Caps/Num) lock states. 17 enum LockStates { 18 LOCK_STATES_CAPSLOCK = 1; 19 LOCK_STATES_NUMLOCK = 2; 20 } 21 22 // True for key press events, and false for key release. 23 optional bool pressed = 2; 24 25 // The USB key code. 26 // The upper 16-bits are the USB Page (0x07 for key events). 27 // The lower 16-bits are the USB Usage ID (which identifies the actual key). 28 optional uint32 usb_keycode = 3; 29 30 // The keyboard lock states. 31 optional uint32 lock_states = 4 [default = 0]; 32 } 33 34 // Text input event for input method different from physical keyboards, 35 // including software keyboard, gesture typing, voice input, etc. 36 message TextEvent { 37 // Unicode sequence for the event in UTF-8. 38 optional string text = 1; 39 } 40 41 // Defines a mouse event message on the event channel. 42 message MouseEvent { 43 44 enum MouseButton { 45 BUTTON_UNDEFINED = 0; 46 BUTTON_LEFT = 1; 47 BUTTON_MIDDLE = 2; 48 BUTTON_RIGHT = 3; 49 BUTTON_MAX = 4; 50 } 51 52 // Mouse position information. 53 optional int32 x = 1; 54 optional int32 y = 2; 55 56 // Mouse button event. 57 optional MouseButton button = 5; 58 optional bool button_down = 6; 59 60 // Mouse wheel information. 61 // These values encode the number of pixels and 'ticks' of movement that 62 // would result from the wheel event on the client system. 63 optional float wheel_delta_x = 7; 64 optional float wheel_delta_y = 8; 65 optional float wheel_ticks_x = 9; 66 optional float wheel_ticks_y = 10; 67 68 // Mouse movement information. Provided only when mouse lock is engaged. 69 optional int32 delta_x = 11; 70 optional int32 delta_y = 12; 71 } 72 73 // Defines an event that sends clipboard data between peers. 74 message ClipboardEvent { 75 76 // The MIME type of the data being sent. 77 optional string mime_type = 1; 78 79 // The data being sent. 80 optional bytes data = 2; 81 } 82