From e6cd6cbd7d0cde084f82388cebe8abbb4072e4a7 Mon Sep 17 00:00:00 2001 From: boulce Date: Mon, 3 Jun 2024 21:01:19 +0900 Subject: [PATCH] feat: delete keyboard input changed --- game/src/game/select_song.rs | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/game/src/game/select_song.rs b/game/src/game/select_song.rs index 8202e49..f44c03f 100644 --- a/game/src/game/select_song.rs +++ b/game/src/game/select_song.rs @@ -47,7 +47,7 @@ pub(crate) fn select_song( let mut hit_right = false; let mut last_left_hit_time = Instant::now(); let mut last_right_hit_time = Instant::now(); - let hit_both_side_time_delay = 5; // ms + let hit_both_side_time_delay = 100; // ms // font information let font_path = &(FONT_PATH.to_owned() + "/sans.ttf"); @@ -129,40 +129,6 @@ pub(crate) fn select_song( if event_loop_common(&event, &mut common_context.coins) { break 'running; } - - match event { - Event::KeyDown { - // if user press right key, then song menu moves to left for specific distance - keycode: Some(Keycode::L), - repeat: false, - .. - } => { - // to prevent changing direction when moving - if moving_direction == MovingDirection::Stop { - // If hitting left side, don't react directly. Just assign false to hit_left - if hit_left == false { - hit_left = true; - last_left_hit_time = Instant::now(); - } - } - } - Event::KeyDown { - // if user press right key, then song menu moves to right for specific distance - keycode: Some(Keycode::K), - repeat: false, - .. - } => { - // to prevent changing direction when moving - if moving_direction == MovingDirection::Stop { - // If hitting right side, don't react directly. Just assign false to hit_right - if hit_right == false { - hit_right = true; - last_right_hit_time = Instant::now(); - } - } - } - _ => {} - } } // process janggu input