| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 module input_device.mojom; |
| 6 |
| 7 enum InputDeviceType { |
| 8 INPUT_DEVICE_INTERNAL, // Internally connected input device. |
| 9 INPUT_DEVICE_EXTERNAL, // Known externally connected input device. |
| 10 INPUT_DEVICE_UNKNOWN, // Device that may or may not be an external device. |
| 11 }; |
| 12 |
| 13 struct InputDevice { |
| 14 // ID of the device. This ID is unique between all input devices. |
| 15 int32 id; |
| 16 |
| 17 // The type of the input device. |
| 18 InputDeviceType type; |
| 19 |
| 20 // Name of the device. |
| 21 string name; |
| 22 |
| 23 // The path to the input device in the sysfs filesystem. |
| 24 string sys_path; |
| 25 |
| 26 // USB-style device identifiers, where available, or 0 if unavailable. |
| 27 uint16 vendor_id; |
| 28 uint16 product_id; |
| 29 }; |
| 30 |
| 31 interface InputDeviceObserver { |
| 32 OnKeyboardDeviceConfigurationChanged(array<InputDevice> devices); |
| 33 OnTouchscreenDeviceConfigurationChanged(array<InputDevice> devices); |
| 34 OnMouseDeviceConfigurationChanged(array<InputDevice> devices); |
| 35 OnTouchpadDeviceConfigurationChanged(array<InputDevice> devices); |
| 36 }; |
| 37 |
| 38 interface InputDeviceService { |
| 39 // Adds an observer to be notified of changes to input devices over Mojo IPC. |
| 40 AddObserver(InputDeviceObserver observer); |
| 41 |
| 42 // Gets list of keyboard input devices. |
| 43 GetKeyboardDevices() => (array<InputDevice> devices); |
| 44 |
| 45 // Gets list of touchscreen input devices. |
| 46 GetTouchscreenDevices() => (array<InputDevice> devices); |
| 47 |
| 48 // Gets list of mouse input devices. |
| 49 GetMouseDevices() => (array<InputDevice> devices); |
| 50 |
| 51 // Gets list of touchpad input devices. |
| 52 GetTouchpadDevices() => (array<InputDevice> devices); |
| 53 }; |
| OLD | NEW |