| // Copyright 2017 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.policy; |
| |
| using fuchsia.ui.input; |
| |
| /// `Presentation.CaptureKeyboardEvent` will consume this listener interface and |
| /// call `OnEvent` when the registered keyboard event occurs. |
| protocol KeyboardCaptureListenerHACK { |
| OnEvent(fuchsia.ui.input.KeyboardEvent event); |
| }; |
| |
| /// `Presentation.CapturePointerEvent` will consume this listener interface and |
| /// call `OnEvent` when a pointer event occurs. |
| protocol PointerCaptureListenerHACK { |
| OnPointerEvent(fuchsia.ui.input.PointerEvent event); |
| }; |
| |
| /// Allows clients of Presenter.Present() to control a presentation. |
| /// Experimental. |
| [Discoverable] |
| protocol Presentation { |
| /// This call exists so that base shell can capture hotkeys and do special |
| /// things with it (e.g., switch a session shell). Phase and modifiers are always |
| /// matched, and valid (non-zero) code points are matched. If there is no |
| /// valid code point, the filter will match against the hid usage value. |
| /// The full KeyboardEvent is supplied to `listener`'s OnEvent. |
| // TODO: Figure out the feasibility of this feature and the best place to put |
| // it. |
| CaptureKeyboardEventHACK(fuchsia.ui.input.KeyboardEvent event_to_capture, |
| KeyboardCaptureListenerHACK listener); |
| |
| /// This call exists so that base shell can capture pointer events. |
| // TODO: Figure out the feasibility of this feature and the best place to put |
| // it. This call will be replaced by gesture disambiguation system in future. |
| CapturePointerEventsHACK(PointerCaptureListenerHACK listener); |
| |
| /// EXPERIMENTAL. Inject pointer events into input stream. This WILL go |
| /// away. Used exclusively by Session Shells to test focus navigation. |
| // TODO(SCN-1186): Delete when RequestFocus is available. |
| [Transitional] |
| InjectPointerEventHACK(fuchsia.ui.input.PointerEvent event); |
| }; |