| // Copyright 2022 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. |
| |
| /// Provides keymap information to clients. |
| library fuchsia.input.wayland; |
| |
| using zx; |
| |
| /// Provides keymap information to Wayland bridge clients. |
| /// |
| /// Provides keymap information in the format required by the |
| /// [`wl_keyboard::keymap`][1] Wayland API event. |
| /// |
| /// We only expect this API to be used by the Wayland bridge. Wayland clients |
| /// expect keymap events to be sent to them when the keymap changes. |
| /// |
| /// [1]: https://wayland.app/protocols/wayland#wl_keyboard:event:keymap |
| @discoverable |
| protocol Keymap { |
| |
| /// Delivers the contents of the keymap in the XKB_V1 format. |
| /// |
| /// This is a hanging get call. |
| /// |
| /// The first call to [Watch] returns immediately. Subsequent calls will only |
| /// return when the keymap changes from what was previously reported. |
| /// |
| Watch() -> (resource struct { |
| /// The contents of the keymap file to apply, mapped into memory. |
| /// |
| /// The Wayland API takes a file descriptor, but Fuchsia's Wayland bridge |
| /// handles the conversion between VMOs and file descriptors. Also, VMOs |
| /// have a size, so we do not need to report it separately. |
| keymap_xkb_v1 zx.handle:VMO; |
| }); |
| }; |