r_efi/protocols/
simple_text_input.rs

1//! Simple Text Input Protocol
2//!
3//! The simple-text-input protocol defines how to read basic key-strokes. It is limited to
4//! non-modifiers and lacks any detailed reporting. It is mostly useful for debugging and admin
5//! interaction.
6
7pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
8    0x387477c1,
9    0x69c7,
10    0x11d2,
11    0x8e,
12    0x39,
13    &[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
14);
15
16#[repr(C)]
17#[derive(Clone, Copy, Debug, Default)]
18pub struct InputKey {
19    pub scan_code: u16,
20    pub unicode_char: crate::base::Char16,
21}
22
23pub type ProtocolReset = eficall! {fn(
24    *mut Protocol,
25    crate::base::Boolean,
26) -> crate::base::Status};
27
28pub type ProtocolReadKeyStroke = eficall! {fn(
29    *mut Protocol,
30    *mut InputKey,
31) -> crate::base::Status};
32
33#[repr(C)]
34pub struct Protocol {
35    pub reset: ProtocolReset,
36    pub read_key_stroke: ProtocolReadKeyStroke,
37    pub wait_for_key: crate::base::Event,
38}