Impossible to create an instance of or use Input struct in uefi::console::text::input
Closed this issue · 2 comments
King-Caleb commented
Impossible to create an instance of or use Input struct in uefi::console::text::input
Hello,
I'm trying to read keyboard input using the latest uefi crate (0.35.0), but I ran into a problem with the Input struct in uefi::console::text::input.
The documentation for Input is very sparse, and it seems impossible to create an instance manually. For example, trying to do something like:
let input = Input::new(); // Doesn't existfails because the struct is opaque and has no public constructor.
I also tried using the system table inside my entry function:
#[entry]
fn kernel_main(handle: Handle, mut st: SystemTable<Boot>) -> Status {
let input = st.stdin(); // returns &Input
// ... but entry function can't have arguments
}Even the docs examples don't work.
Could the maintainers clarify:
- How to properly obtain and use an
Inputhandle inuefi 0.35.0? - Are there any working examples for reading keyboard input with the current version?
Thank you for your time and for maintaining the crate!
nicholasbishop commented
You can use uefi::system::with_stdin to use the Input protocol. I've uploaded a PR adding an example: #1755
For more general information on how to work with protocols, see: