Skip to content

Commit 7dcda6f

Browse files
eagleivgXottab-DUTY
authored andcommitted
xrEngine: fix mouse hold butons
1 parent c078088 commit 7dcda6f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/xrEngine/xr_input.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ BOOL CInput::iGetAsyncKeyState(int dik)
154154
return FALSE; // unknown key ???
155155
}
156156

157-
BOOL CInput::iGetAsyncBtnState(int btn) { return !!mouseState[btn]; }
157+
BOOL CInput::iGetAsyncBtnState(int btn)
158+
{
159+
if (btn <= COUNT_MOUSE_BUTTONS)
160+
return !!mouseState[btn + 1];
161+
}
158162
void CInput::ClipCursor(bool clip)
159163
{
160164
if (clip)
@@ -283,7 +287,6 @@ void CInput::OnFrame(void)
283287
#endif
284288
{
285289
mouseState[event.button.button] = FALSE;
286-
// cbStack.back()->IR_OnMouseRelease(event.button.button);
287290
cbStack.back()->IR_OnKeyboardRelease(SDL_NUM_SCANCODES + event.button.button);
288291
}
289292
break;
@@ -293,11 +296,7 @@ void CInput::OnFrame(void)
293296
#endif
294297
{
295298
mouseState[event.button.button] = TRUE;
296-
// cbStack.back()->IR_OnMousePress(event.button.button);
297299
cbStack.back()->IR_OnKeyboardPress(SDL_NUM_SCANCODES + event.button.button);
298-
299-
if (mouseState[event.button.button])
300-
cbStack.back()->IR_OnMouseHold(event.button.button);
301300
}
302301
break;
303302
case SDL_MOUSEWHEEL:

0 commit comments

Comments
 (0)