Skip to content

Commit 32667ea

Browse files
committed
Change the intensity keys in the sky-on-shader example.
Currently you can use '+'/'-' on the numeric keypad to adjust the intensity, but lots of keyboards lack a numeric keypad. This commit changes it to use the up and down arrows instead.
1 parent 99662f2 commit 32667ea

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

examples/runners/ash/src/main.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,22 +210,10 @@ pub fn main() {
210210
});
211211
}
212212
}
213-
_ => {}
214-
},
215-
WindowEvent::KeyboardInput {
216-
event:
217-
winit::event::KeyEvent {
218-
physical_key: winit::keyboard::PhysicalKey::Code(key_code),
219-
state: winit::event::ElementState::Pressed,
220-
..
221-
},
222-
..
223-
} => match key_code {
224-
winit::keyboard::KeyCode::NumpadAdd
225-
| winit::keyboard::KeyCode::NumpadSubtract => {
213+
winit::keyboard::NamedKey::ArrowUp | winit::keyboard::NamedKey::ArrowDown => {
226214
let factor =
227215
&mut ctx.sky_fs_spec_id_0x5007_sun_intensity_extra_spec_const_factor;
228-
*factor = if key_code == winit::keyboard::KeyCode::NumpadAdd {
216+
*factor = if key == winit::keyboard::NamedKey::ArrowUp {
229217
factor.saturating_add(1)
230218
} else {
231219
factor.saturating_sub(1)

0 commit comments

Comments
 (0)