Debian Codegraph @

.cargo/vendor/r-efi/src/protocols/simple_text_input_ex.rs

raw
1 //! Extended Simple Text Input Protocol
2 //!
3 //! The simple-text-input-ex protocol extends the simple-text-input protocol by allowing more
4 //! details reporting about modifiers, etc.
5
6 pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
7 0xdd9e7534,
8 0x7762,
9 0x4698,
10 0x8c,
11 0x14,
12 &[0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa],
13 );
14
15 pub const SHIFT_STATE_VALID: u32 = 0x80000000u32;
16 pub const RIGHT_SHIFT_PRESSED: u32 = 0x00000001u32;
17 pub const LEFT_SHIFT_PRESSED: u32 = 0x00000002u32;
18 pub const RIGHT_CONTROL_PRESSED: u32 = 0x00000004u32;
19 pub const LEFT_CONTROL_PRESSED: u32 = 0x00000008u32;
20 pub const RIGHT_ALT_PRESSED: u32 = 0x00000010u32;
21 pub const LEFT_ALT_PRESSED: u32 = 0x00000020u32;
22 pub const RIGHT_LOGO_PRESSED: u32 = 0x00000040u32;
23 pub const LEFT_LOGO_PRESSED: u32 = 0x00000080u32;
24 pub const MENU_KEY_PRESSED: u32 = 0x00000100u32;
25 pub const SYS_REQ_PRESSED: u32 = 0x00000200u32;
26
27 pub const TOGGLE_STATE_VALID: u8 = 0x80u8;
28 pub const KEY_STATE_EXPOSED: u8 = 0x40u8;
29 pub const SCROLL_LOCK_ACTIVE: u8 = 0x01u8;
30 pub const NUM_LOCK_ACTIVE: u8 = 0x02u8;
31 pub const CAPS_LOCK_ACTIVE: u8 = 0x04u8;
32
33 pub type KeyToggleState = u8;
34 pub type KeyNotifyFunction = eficall! {fn(*mut KeyData) -> crate::base::Status};
35
36 #[repr(C)]
37 #[derive(Clone, Copy, Debug, Default)]
38 pub struct KeyState {
39 pub key_shift_state: u32,
40 pub key_toggle_state: KeyToggleState,
41 }
42
43 #[repr(C)]
44 #[derive(Clone, Copy, Debug, Default)]
45 pub struct KeyData {
46 pub key: crate::protocols::simple_text_input::InputKey,
47 pub key_state: KeyState,
48 }
49
50 pub type ProtocolReset = eficall! {fn(
51 *mut Protocol,
52 crate::base::Boolean,
53 ) -> crate::base::Status};
54
55 pub type ProtocolReadKeyStrokeEx = eficall! {fn(
56 *mut Protocol,
57 *mut KeyData,
58 ) -> crate::base::Status};
59
60 pub type ProtocolSetState = eficall! {fn(
61 *mut Protocol,
62 *mut KeyToggleState,
63 ) -> crate::base::Status};
64
65 pub type ProtocolRegisterKeyNotify = eficall! {fn(
66 *mut Protocol,
67 *mut KeyData,
68 KeyNotifyFunction,
69 *mut *mut core::ffi::c_void,
70 ) -> crate::base::Status};
71
72 pub type ProtocolUnregisterKeyNotify = eficall! {fn(
73 *mut Protocol,
74 *mut core::ffi::c_void,
75 ) -> crate::base::Status};
76
77 #[repr(C)]
78 pub struct Protocol {
79 pub reset: ProtocolReset,
80 pub read_key_stroke_ex: ProtocolReadKeyStrokeEx,
81 pub wait_for_key_ex: crate::base::Event,
82 pub set_state: ProtocolSetState,
83 pub register_key_notify: ProtocolRegisterKeyNotify,
84 pub unregister_key_notify: ProtocolUnregisterKeyNotify,
85 }