aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/3rdparty/doom/i_video.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/demos/3rdparty/doom/i_video.c b/demos/3rdparty/doom/i_video.c
index 6f045ebf..20761fc9 100644
--- a/demos/3rdparty/doom/i_video.c
+++ b/demos/3rdparty/doom/i_video.c
@@ -124,6 +124,7 @@ int xlatekey(void)
void I_GetEvent(void)
{
event_t event;
+ static uint16_t last_buttons = 0;
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
GEventMouse mev;
@@ -132,8 +133,8 @@ void I_GetEvent(void)
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
ginputGetMouseStatus(0, &mev);
event.type = ev_mouse;
- event.data1 = mev.current_buttons & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE);
- if ((mev.current_buttons ^ mev.last_buttons) & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE)) {
+ event.data1 = mev.buttons & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE);
+ if ((mev.buttons ^ last_buttons) & (GINPUT_MOUSE_BTN_LEFT|GINPUT_MOUSE_BTN_RIGHT|GINPUT_MOUSE_BTN_MIDDLE)) {
event.data2 = event.data3 = 0;
} else {
event.data2 = (mev.x - lastmousex) << 2;
@@ -149,6 +150,8 @@ void I_GetEvent(void)
}
}
+ last_buttons = mev.buttons;
+
#endif
#if 0
event_t event;