Fix inpuit requiring ALT key

Common on Mac, maybe other platforms too.

Closes https://github.com/emilk/egui/issues/1795

Bug introduced in https://github.com/emilk/egui/pull/1697
This commit is contained in:
Emil Ernerfeldt 2022-07-21 20:25:53 +02:00
parent 0338843950
commit 0337d78eaa

View file

@ -200,7 +200,7 @@ impl State {
let is_mac_cmd = cfg!(target_os = "macos") let is_mac_cmd = cfg!(target_os = "macos")
&& (self.egui_input.modifiers.ctrl || self.egui_input.modifiers.mac_cmd); && (self.egui_input.modifiers.ctrl || self.egui_input.modifiers.mac_cmd);
if is_printable_char(*ch) && !is_mac_cmd && !self.egui_input.modifiers.alt { if is_printable_char(*ch) && !is_mac_cmd {
self.egui_input self.egui_input
.events .events
.push(egui::Event::Text(ch.to_string())); .push(egui::Event::Text(ch.to_string()));