Skip to content

Commit

Permalink
xrEngine: fix mouse hold butons
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg authored and Xottab-DUTY committed Jul 24, 2018
1 parent c078088 commit 7dcda6f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/xrEngine/xr_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ BOOL CInput::iGetAsyncKeyState(int dik)
return FALSE; // unknown key ???
}

BOOL CInput::iGetAsyncBtnState(int btn) { return !!mouseState[btn]; }
BOOL CInput::iGetAsyncBtnState(int btn)
{
if (btn <= COUNT_MOUSE_BUTTONS)
return !!mouseState[btn + 1];
}
void CInput::ClipCursor(bool clip)
{
if (clip)
Expand Down Expand Up @@ -283,7 +287,6 @@ void CInput::OnFrame(void)
#endif
{
mouseState[event.button.button] = FALSE;
// cbStack.back()->IR_OnMouseRelease(event.button.button);
cbStack.back()->IR_OnKeyboardRelease(SDL_NUM_SCANCODES + event.button.button);
}
break;
Expand All @@ -293,11 +296,7 @@ void CInput::OnFrame(void)
#endif
{
mouseState[event.button.button] = TRUE;
// cbStack.back()->IR_OnMousePress(event.button.button);
cbStack.back()->IR_OnKeyboardPress(SDL_NUM_SCANCODES + event.button.button);

if (mouseState[event.button.button])
cbStack.back()->IR_OnMouseHold(event.button.button);
}
break;
case SDL_MOUSEWHEEL:
Expand Down

0 comments on commit 7dcda6f

Please sign in to comment.