Skip to content

Commit 87526c5

Browse files
authored
Merge pull request #20 from hatoo/gamepad
support gamepad
2 parents e5d7094 + 0ebf1df commit 87526c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ fn tap(
428428
mut commands: Commands,
429429
audio_handles: Res<AudioHandles>,
430430
keyboard_input: Res<ButtonInput<KeyCode>>,
431+
game_pad: Query<&Gamepad>,
431432
buttons: Res<ButtonInput<MouseButton>>,
432433
touches: Res<Touches>,
433434
last_tick: Res<LastTick>,
@@ -439,6 +440,9 @@ fn tap(
439440
if keyboard_input.get_just_pressed().count() > 0
440441
|| buttons.get_just_pressed().count() > 0
441442
|| touches.any_just_pressed()
443+
|| game_pad
444+
.iter()
445+
.any(|game_pad| game_pad.get_just_pressed().count() > 0)
442446
{
443447
if !mute.tap_mute {
444448
commands.spawn((

0 commit comments

Comments
 (0)