1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Add comment explaining Tab button (#2872)

This commit is contained in:
Brian Janssen
2023-08-09 11:48:54 +02:00
committed by GitHub
parent 387b075681
commit 67ba4f2811

View File

@@ -307,6 +307,7 @@ impl State {
} }
WindowEvent::KeyboardInput { input, .. } => { WindowEvent::KeyboardInput { input, .. } => {
self.on_keyboard_input(input); self.on_keyboard_input(input);
// When pressing the Tab key, egui focuses the first focusable element, hence Tab always consumes.
let consumed = egui_ctx.wants_keyboard_input() let consumed = egui_ctx.wants_keyboard_input()
|| input.virtual_keycode == Some(winit::event::VirtualKeyCode::Tab); || input.virtual_keycode == Some(winit::event::VirtualKeyCode::Tab);
EventResponse { EventResponse {