From 45d05cecf0b7eabfdce2fb7ac93e9bdb96d180ff Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:33:31 +0100 Subject: [PATCH] ignore HatState::Centered when configuring input (#151) --- src/ui/input.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ui/input.rs b/src/ui/input.rs index e05f92f9..6639e361 100644 --- a/src/ui/input.rs +++ b/src/ui/input.rs @@ -407,12 +407,14 @@ pub fn configure_input_profile(ui: &mut ui::Ui, profile: String) { key_set = true } sdl2::event::Event::JoyHatMotion { hat_idx, state, .. } => { - new_joystick_hat[*value] = ( - true, - hat_idx as u32, - sdl2::joystick::HatState::to_raw(state), - ); - key_set = true + if state != sdl2::joystick::HatState::Centered { + new_joystick_hat[*value] = ( + true, + hat_idx as u32, + sdl2::joystick::HatState::to_raw(state), + ); + key_set = true + } } sdl2::event::Event::JoyAxisMotion { axis_idx,