blob: 4a97888aba03439bcac823ac9acd77cdfe6e810c [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.settings;
using fuchsia.input;
using zx;
/// The various keyboard settings.
type KeyboardSettings = table {
1: keymap fuchsia.input.KeymapId;
2: autorepeat struct {
/// The duration between key actuation and autorepeat actuation.
delay zx.Duration;
/// The duration between two successive autorepeat actuations (1/rate). Rate is defined as
/// once the autorepeat kicks in, the frequency at which repeated key actuations are
/// generated per second.
period zx.Duration;
};
};
/// The mutable API for modifying the keyboard settings.
closed protocol KeyboardSet {
/// Setting protocol: if a field is left unset, it is not modified.
/// To clear a field, set it to its type's "zero" value.
strict Set(struct {
settings KeyboardSettings;
}) -> () error Error;
};
/// The read-only API for monitoring the changes to the keyboard settings.
closed protocol KeyboardWatch {
/// The Watch protocol is the same as in the other `fuchsia.settings.*` protocols.
///
/// Returns immediately on first call; on subsequent calls it blocks until the settings
/// change, and then returns following the "hanging get" pattern.
strict Watch() -> (struct {
settings KeyboardSettings;
});
};
/// The SetUI protocol for reading and modifying the keyboard settings.
@discoverable
closed protocol Keyboard {
compose KeyboardSet;
compose KeyboardWatch;
};