blob: b69b1e63d405460e6b59a5fe9b84b0e3153b8f69 [file] [log] [blame]
// Copyright 2019 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.ui.text;
using fuchsia.ui.input;
using fuchsia.ui.input3;
/// A service provided to keyboard apps that allows them to access a TextField
/// interface for the currently focused text field. Requests to this TextField
/// interface are proxied through the TextManager to batch edits together,
/// and to ensure requests aren't sent to unfocused TextFields.
[Discoverable, Deprecated]
protocol TextInputContextLegacy {
/// Tells anyone listening to ImeVisibilityService (usually a shell) to hide
/// the onscreen keyboard.
HideKeyboard();
/// This event fires any time a new text field is focused. It also is sent to
/// newly connected keyboards when they connect, if there is a focused text
/// field. If focus is lost, the TextField handle will be closed.
-> OnFocus(TextFieldLegacy text_field);
/// This event fires any time a physical keyboard event is sent to the
/// TextManager. The keyboard may translate it into an edit on the focused
/// text field if it so desires. It's expected that this interface will change
/// as the routing for keyboard events and keymaps evolves.
/// Deprecated: `OnKey3Event` should be used instead.
-> OnInputEvent(fuchsia.ui.input.InputEvent event);
/// This event fires any time a physical keyboard event is sent to the
/// TextManager. The keyboard may translate it into an edit on the focused
/// text field if it so desires. It's expected that this interface will change
/// as the routing for keyboard events and keymaps evolves.
[Transitional]
-> OnKey3Event(fuchsia.ui.input3.KeyEvent event);
};