Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds
egui::KeyboardShortcut
which isModifiers
+Key
.You can check it with
input.consume_shortcut
.You can format it to text using
Context::format_shortcut
.You can set that text on buttons (e.g. for menus) with
Button::shortcut_text
.If you use
Modifiers::COMMAND
, egui will check it against the Mac Command key (⌘) on Mac, but check against Ctrl on other platforms. This means how the shortcut is formatted depends on the OS you are running on. This is difficult to know when compiling forwasm32
, soegui
now also hasContext::set_os
andContext::os
to set/get that.set_os
is meant for egui integrartions.eframe
will guess the OS from theUser-Agent
string when on web. On native it will usetarget_os
.Bonus 1: You can now ask
eframe
about theUser-Agent
string when on web usingframe.info().web_info.user_agent
.Bonus 2: You can now query if epaint/egui can show some characters by using
Fonts::has_glyph(s)
.TODO: