shithub: choc

Download patch

ref: d66009a89528c4a8686319a7e6b1975383187080
parent: 080ed4ee4324fa873b4049f5cda8749d9bd801c7
author: Michael Day <43701387+mikeday0@users.noreply.github.com>
date: Wed Jan 25 21:38:01 EST 2023

doom: Fix mouse event causing unwanted key press (#1570)

If a particular in-game action and an in-menu action share a common
keybind, then the mouse event which also causes that in-menu action will
trigger the in-game action when outside of the menus. Add check to
prevent this from happening.

--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -1478,7 +1478,7 @@
     }
     else
     {
-	if (ev->type == ev_mouse && mousewait < I_GetTime())
+	if (ev->type == ev_mouse && mousewait < I_GetTime() && menuactive)
 	{
 	    mousey += ev->data3;
 	    if (mousey < lasty-30)