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

4 missing function keys #3990

Closed
NotQuiteApex opened this issue Feb 6, 2024 · 1 comment · Fixed by #4004
Closed

4 missing function keys #3990

NotQuiteApex opened this issue Feb 6, 2024 · 1 comment · Fixed by #4004

Comments

@NotQuiteApex
Copy link

Is your feature request related to a problem? Please describe.
egui currently supports F1-F20 keys as keyboard inputs. USB HID defines function keys F1-F24. See this document, specifically section 0x07, Keyboard/Keypad Page (page 82).

Describe the solution you'd like
F21, F22, F23, and F24 to be made available as input keys like F1-F20.

Describe alternatives you've considered
N/A

Additional context
The function keys 1 through 20 were implemented in PR #1665, after being discussed briefly in #1336. The pull request mentions Mozilla's web documentation as defining only F1-F20 but I could not find such documentation. Other web applications, such as this JavaScript key event tester seem to support reading arbitrary scancodes and specifically the function keys just fine

@oscargus
Copy link
Contributor

oscargus commented Feb 8, 2024

It seems like winit supports keys up to F35, so should just be to add them.

https://github.com/rust-windowing/winit/blob/20687fef1c64dbd0a14cf6a3fcf9baebdfe0313e/src/keyboard.rs#L703-L737

(For anyone giving this a go, it is worth noting that the structure has changes since the PR pointed out above.)

emilk pushed a commit that referenced this issue Feb 8, 2024
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo cranky`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

* Closes <#3990>

`winit` supports up to F35, so thought it was better to just add them
all.
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

Successfully merging a pull request may close this issue.

2 participants