Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with user input and boot services at the same time #838

Open
DecrepitHuman opened this issue May 31, 2023 · 3 comments
Open

Trouble with user input and boot services at the same time #838

DecrepitHuman opened this issue May 31, 2023 · 3 comments

Comments

@DecrepitHuman
Copy link

I've written a display driver using embedded_graphics and the GraphicsOutput protocol. I'm using that to display geometry & text to the screen, and need to get keyboard input at the same time. I cannot do this at the moment because of the mutable borrow at SystemTable<Boot>::stdin() and the immutable borrow at SystemTable<Boot>::boot_services() that is used for the display driver. I can break these rules by casting the struct to a pointer and then de-referencing it to obtain a new "owned" instance but this is most definitely a ugly solution and I'm not 100% if this will cause problems (more specifically, I don't know if this will interfere with the ::boot_services() call).

@DecrepitHuman DecrepitHuman changed the title Trouble with user input Trouble with user input and boot services at the same time May 31, 2023
@nicholasbishop
Copy link
Contributor

This is indeed an area that is inconvenient as things currently stand. I think probably the easiest workaround for now is to use https://docs.rs/uefi/latest/uefi/table/struct.SystemTable.html#method.unsafe_clone to make a copy of the table and access stdin() via that copy.

@sky5454
Copy link
Contributor

sky5454 commented May 11, 2024

see exam https://github.com/slint-ui/slint/tree/master/examples/uefi-demo

@phip1611
Copy link
Contributor

By the way, this is going to be closed by #905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants