diff --git a/demo/common/src/lib.rs b/demo/common/src/lib.rs index e3b8c9d3..4f1abcb7 100644 --- a/demo/common/src/lib.rs +++ b/demo/common/src/lib.rs @@ -341,6 +341,13 @@ impl DemoApp where W: Window { self.dirty = true; } } + Event::KeyDown(Keycode::Tab) => { + self.options.ui = match self.options.ui { + UIVisibility::None => UIVisibility::Stats, + UIVisibility::Stats => UIVisibility::All, + UIVisibility::All => UIVisibility::None, + } + } Event::OpenSVG(ref svg_path) => { let built_svg = load_scene(self.window.resource_loader(), svg_path); self.ui.message = get_svg_building_message(&built_svg); diff --git a/demo/common/src/window.rs b/demo/common/src/window.rs index 76345b93..1fbd08e0 100644 --- a/demo/common/src/window.rs +++ b/demo/common/src/window.rs @@ -57,6 +57,7 @@ pub enum Event { pub enum Keycode { Alphanumeric(u8), Escape, + Tab, } #[derive(Clone, Copy, Debug)] diff --git a/demo/native/src/main.rs b/demo/native/src/main.rs index 00c082c6..ef5cec8e 100644 --- a/demo/native/src/main.rs +++ b/demo/native/src/main.rs @@ -227,6 +227,7 @@ impl WindowImpl { fn convert_sdl_keycode(&self, sdl_keycode: SDLKeycode) -> Option { match sdl_keycode { SDLKeycode::Escape => Some(Keycode::Escape), + SDLKeycode::Tab => Some(Keycode::Tab), sdl_keycode if sdl_keycode as i32 >= SDLKeycode::A as i32 && sdl_keycode as i32 <= SDLKeycode::Z as i32 => { let offset = (sdl_keycode as i32 - SDLKeycode::A as i32) as u8;