Skip to content

Commit

Permalink
keep joystick events connected to BindingCapture after capture has ha…
Browse files Browse the repository at this point in the history
…ppened
  • Loading branch information
johnbartholomew committed Dec 30, 2013
1 parent 85aba36 commit 1ca7836
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/gameui/BindingCapture.cpp
Expand Up @@ -34,7 +34,6 @@ void KeyBindingCapture::HandleKeyDown(const UI::KeyboardEvent &event)
// (keycodes for modifier keys are contiguous between SDLK_LCTRL and SDLK_RGUI)
const SDL_Keymod mod = ((key >= SDLK_LCTRL && key <= SDLK_RGUI) ? KMOD_NONE : event.keysym.mod);
m_binding = KeyBindings::KeyBinding::FromKeyMod(key, mod);
Disconnect();
onCapture.emit(m_binding);
}
}
Expand All @@ -56,15 +55,13 @@ void KeyBindingCapture::Disconnect()
bool KeyBindingCapture::OnJoystickHatMove(const UI::JoystickHatMotionEvent &event)
{
m_binding = KeyBindings::KeyBinding::FromJoystickHat(event.joystick, event.hat, static_cast<Uint8>(event.direction));
Disconnect();
onCapture.emit(m_binding);
return true;
}

bool KeyBindingCapture::OnJoystickButtonDown(const UI::JoystickButtonEvent &event)
{
m_binding = KeyBindings::KeyBinding::FromJoystickButton(event.joystick, event.button);
Disconnect();
onCapture.emit(m_binding);
return true;
}
Expand Down Expand Up @@ -109,7 +106,6 @@ bool AxisBindingCapture::OnJoystickAxisMove(const UI::JoystickAxisMotionEvent &e
m_binding.joystick = event.joystick;
m_binding.axis = event.axis;
m_binding.direction = (event.value > 0 ? KeyBindings::POSITIVE : KeyBindings::NEGATIVE);
Disconnect();
onCapture.emit(m_binding);
return true;
}
Expand Down

0 comments on commit 1ca7836

Please sign in to comment.