Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
tomara-x committed Feb 20, 2024
1 parent 272ff56 commit 4fae590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/toggle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ fn setup(mut commands: Commands) {
}
}

fn toggle_key(mut query: Query<&mut PanCam>, keys: Res<Input<KeyCode>>) {
fn toggle_key(mut query: Query<&mut PanCam>, keys: Res<ButtonInput<KeyCode>>) {
// Space = Toggle Panning
if keys.just_pressed(KeyCode::Space) {
for mut pancam in &mut query {
pancam.enabled = !pancam.enabled;
}
}
// T = Toggle Zoom to Cursor
if keys.just_pressed(KeyCode::T) {
if keys.just_pressed(KeyCode::KeyT) {
for mut pancam in &mut query {
pancam.zoom_to_cursor = !pancam.zoom_to_cursor;
}
Expand Down

0 comments on commit 4fae590

Please sign in to comment.