blob: aae2e0a7013d22d817e01082a059faa11aa16064 [file] [log] [blame]
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module device.mojom;
// This input_service.mojom defines structs and interfaces for providing
// information and notifiations about connected/disconnected input/HID
// devices.
enum InputDeviceSubsystem {
SUBSYSTEM_HID = 0,
SUBSYSTEM_INPUT = 1,
SUBSYSTEM_UNKNOWN = 2,
};
enum InputDeviceType {
TYPE_BLUETOOTH = 0,
TYPE_USB = 1,
TYPE_SERIO = 2,
TYPE_UNKNOWN = 3,
};
struct InputDeviceInfo {
string id;
string name;
InputDeviceSubsystem subsystem;
InputDeviceType type;
bool is_accelerometer;
bool is_joystick;
bool is_key;
bool is_keyboard;
bool is_mouse;
bool is_tablet;
bool is_touchpad;
bool is_touchscreen;
};
interface InputDeviceManagerClient {
// Notifies the client that a device is added.
InputDeviceAdded(InputDeviceInfo device_info);
// Notifies the client that a device is removed.
InputDeviceRemoved(string id);
};
interface InputDeviceManager {
// Returns list of all currently connected input/hid devices and set client
// to InputDeviceManager. The implementation of InputDeviceManager guarantees
// the returned callback is always posted earlier than InputDeviceAdded()
// and InputDeviceRemoved().
GetDevicesAndSetClient(
pending_associated_remote<InputDeviceManagerClient> client) =>
(array<InputDeviceInfo> devices);
// Returns list of all currently connected input/hid devices only.
GetDevices() => (array<InputDeviceInfo> devices);
};