Commit e8b6753f authored by Gerhard Stein's avatar Gerhard Stein

Improved handling of vpad. Ready for another look and feel test

parent 12734a95
......@@ -260,6 +260,29 @@ bool VirtualKeenControl::mouseState(const Vector2D<float> &Pos, const bool down)
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
auto unbindButtonCommand = [&](const TouchButton &button,
const InputCommand &cmd)
{
gInput.setCommand(0, cmd, false);
};
unbindButtonCommand(mConfirmButton, IC_JUMP);
unbindButtonCommand(mStartButton, IC_JUMP);
unbindButtonCommand(mStatusButton, IC_STATUS);
unbindButtonCommand(mShootButton, IC_FIRE);
unbindButtonCommand(mJumpButton, IC_JUMP);
unbindButtonCommand(mPogoButton, IC_POGO);
// Always sent released first, better for VPads
SDL_Event evUp;
evUp.type = SDL_KEYUP;
evUp.key.keysym.sym = SDLK_UP; SDL_PushEvent(&evUp);
evUp.key.keysym.sym = SDLK_LEFT; SDL_PushEvent(&evUp);
evUp.key.keysym.sym = SDLK_RIGHT; SDL_PushEvent(&evUp);
evUp.key.keysym.sym = SDLK_DOWN; SDL_PushEvent(&evUp);
if( !mPadBackground.isInside(Pos.x, Pos.y) )
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment