Skip to content

Commit

Permalink
document that egui::Key::key may contain a physical key code
Browse files Browse the repository at this point in the history
  • Loading branch information
TicClick committed May 10, 2024
1 parent 86cc395 commit 73d9ecc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/egui/src/data/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,12 @@ pub enum Event {

/// A key was pressed or released.
Key {
/// The logical key, heeding the users keymap.
/// Most of the time, it's the logical key, heeding the active keymap -- for instance, if the user has Dvorak
/// keyboard layout, it will be taken into account.
///
/// For instance, if the user is using Dvorak keyboard layout,
/// this will take that into account.
/// If it's impossible to determine the logical key on desktop platforms (say, in case of non-Latin letters),
/// `key` falls back to the value of the corresponding physical key. This is necessary for proper work of
/// standard shortcuts that only respond to Latin-based bindings (such as `Ctrl` + `V`).
key: Key,

/// The physical key, corresponding to the actual position on the keyboard.
Expand Down

0 comments on commit 73d9ecc

Please sign in to comment.