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

Capture additional keys (Media keys, caps lock, etc.) #895

Open
SammyWhamy opened this issue May 25, 2024 · 0 comments
Open

Capture additional keys (Media keys, caps lock, etc.) #895

SammyWhamy opened this issue May 25, 2024 · 0 comments

Comments

@SammyWhamy
Copy link

Is your feature request related to a problem? Please describe.
I would like to be able to control a media player in the terminal using my hardware media keys, but these are not captured by crossterm.

Describe the solution you'd like
I'd like the read/poll functions to also report keys such as the hardware multimedia keys, along with keys like num lock, caps lock, etc.
It would also be nice if keys like shift and ctrl could be reported separately, instead of only as modifiers.

Additional context
Windows 11, cmd/powershell, Windows Terminal
I have played around a bit with the crossterm_winapi crate, and I was able to fairly easy get readings for these keys. Using the following

let handle = crossterm_winapi::Handle::current_in_handle()?;
let console = crossterm_winapi::Console::from(handle);
let key = console.read_single_input_event()?;

Seeing as how easy this was to do, I feel like i might be overlooking something in crossterm, but I can't find any way to get readings for these keys.

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

1 participant