Skip to content

Commit ba8bad3

Browse files
authored
Merge pull request #1371 from nicholasbishop/bishop-input-docs
uefi: Update input protocol docs
2 parents 5466455 + ec84d34 commit ba8bad3

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

uefi/src/proto/console/text/input.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ impl Input {
2424

2525
/// Reads the next keystroke from the input device, if any.
2626
///
27-
/// Use [`wait_for_key_event`] with the [`BootServices::wait_for_event`]
27+
/// Use [`wait_for_key_event`] with the [`boot::wait_for_event`]
2828
/// interface in order to wait for a key to be pressed.
2929
///
30-
/// [`BootServices::wait_for_event`]: uefi::table::boot::BootServices::wait_for_event
30+
/// [`boot::wait_for_event`]: crate::boot::wait_for_event
3131
/// [`wait_for_key_event`]: Self::wait_for_key_event
3232
///
3333
/// # Errors
@@ -39,16 +39,13 @@ impl Input {
3939
/// ```
4040
/// use log::info;
4141
/// use uefi::proto::console::text::{Input, Key, ScanCode};
42-
/// use uefi::table::boot::BootServices;
43-
/// use uefi::{Char16, Result, ResultExt};
42+
/// use uefi::{boot, Char16, Result, ResultExt};
4443
///
45-
/// fn read_keyboard_events(boot_services: &BootServices, input: &mut Input) -> Result {
44+
/// fn read_keyboard_events(input: &mut Input) -> Result {
4645
/// loop {
4746
/// // Pause until a keyboard event occurs.
4847
/// let mut events = unsafe { [input.wait_for_key_event().unwrap()] };
49-
/// boot_services
50-
/// .wait_for_event(&mut events)
51-
/// .discard_errdata()?;
48+
/// boot::wait_for_event(&mut events).discard_errdata()?;
5249
///
5350
/// let u_key = Char16::try_from('u').unwrap();
5451
/// match input.read_key()? {
@@ -79,8 +76,10 @@ impl Input {
7976
}
8077
}
8178

82-
/// Event to be used with `BootServices::wait_for_event()` in order to wait
79+
/// Event to be used with [`boot::wait_for_event`] in order to wait
8380
/// for a key to be available
81+
///
82+
/// [`boot::wait_for_event`]: crate::boot::wait_for_event
8483
#[must_use]
8584
pub fn wait_for_key_event(&self) -> Option<Event> {
8685
unsafe { Event::from_ptr(self.0.wait_for_key) }

0 commit comments

Comments
 (0)