mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 12:04:38 -04:00
parent
ae746f5dc5
commit
445c049612
@ -859,8 +859,7 @@ boolean AM_Responder
|
|||||||
rc = false;
|
rc = false;
|
||||||
else if (M_InputActivated(input_map_zoomout))
|
else if (M_InputActivated(input_map_zoomout))
|
||||||
{
|
{
|
||||||
if (ev->type == ev_mouseb_down &&
|
if (ev->type == ev_mouseb_down && M_IsMouseWheel(ev->data1))
|
||||||
(ev->data1 == MOUSE_BUTTON_WHEELUP || ev->data1 == MOUSE_BUTTON_WHEELDOWN))
|
|
||||||
{
|
{
|
||||||
mousewheelzoom = true;
|
mousewheelzoom = true;
|
||||||
mtof_zoommul = m_zoomout_mouse;
|
mtof_zoommul = m_zoomout_mouse;
|
||||||
@ -874,8 +873,7 @@ boolean AM_Responder
|
|||||||
}
|
}
|
||||||
else if (M_InputActivated(input_map_zoomin))
|
else if (M_InputActivated(input_map_zoomin))
|
||||||
{
|
{
|
||||||
if (ev->type == ev_mouseb_down &&
|
if (ev->type == ev_mouseb_down && M_IsMouseWheel(ev->data1))
|
||||||
(ev->data1 == MOUSE_BUTTON_WHEELUP || ev->data1 == MOUSE_BUTTON_WHEELDOWN))
|
|
||||||
{
|
{
|
||||||
mousewheelzoom = true;
|
mousewheelzoom = true;
|
||||||
mtof_zoommul = m_zoomin_mouse;
|
mtof_zoommul = m_zoomin_mouse;
|
||||||
|
@ -363,7 +363,7 @@ static const struct
|
|||||||
{ MOUSE_BUTTON_WHEELUP, "wheelup" },
|
{ MOUSE_BUTTON_WHEELUP, "wheelup" },
|
||||||
{ MOUSE_BUTTON_WHEELDOWN, "wheeldown" },
|
{ MOUSE_BUTTON_WHEELDOWN, "wheeldown" },
|
||||||
{ MOUSE_BUTTON_WHEELLEFT, "wheelleft" },
|
{ MOUSE_BUTTON_WHEELLEFT, "wheelleft" },
|
||||||
{ MOUSE_BUTTON_WHEELRIGHT, "wheelright" },
|
{ MOUSE_BUTTON_WHEELRIGHT,"wheelright" },
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* M_GetNameForKey(int key)
|
const char* M_GetNameForKey(int key)
|
||||||
@ -431,3 +431,9 @@ int M_GetMouseBForName(const char* name)
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean M_IsMouseWheel(int mouseb)
|
||||||
|
{
|
||||||
|
return mouseb >= MOUSE_BUTTON_WHEELUP &&
|
||||||
|
mouseb <= MOUSE_BUTTON_WHEELRIGHT;
|
||||||
|
}
|
||||||
|
@ -179,4 +179,6 @@ int M_GetJoyBForName(const char* name);
|
|||||||
const char* M_GetNameForMouseB(int joyb);
|
const char* M_GetNameForMouseB(int joyb);
|
||||||
int M_GetMouseBForName(const char* name);
|
int M_GetMouseBForName(const char* name);
|
||||||
|
|
||||||
|
boolean M_IsMouseWheel(int mouseb);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5830,9 +5830,8 @@ boolean M_Responder (event_t* ev)
|
|||||||
// Don't bind movement and turning to mouse wheel. It needs to
|
// Don't bind movement and turning to mouse wheel. It needs to
|
||||||
// be impossible to input a one-frame of movement automatically
|
// be impossible to input a one-frame of movement automatically
|
||||||
// in speedrunning.
|
// in speedrunning.
|
||||||
if ((ch == MOUSE_BUTTON_WHEELUP || ch == MOUSE_BUTTON_WHEELDOWN ||
|
if (M_IsMouseWheel(ch) &&
|
||||||
ch == MOUSE_BUTTON_WHEELLEFT || ch == MOUSE_BUTTON_WHEELRIGHT) &&
|
s_input >= input_forward && s_input <= input_straferight)
|
||||||
s_input >= input_forward && s_input <= input_straferight)
|
|
||||||
return true;
|
return true;
|
||||||
for (i = 0 ; keys_settings[i] && search ; i++)
|
for (i = 0 ; keys_settings[i] && search ; i++)
|
||||||
for (ptr2 = keys_settings[i] ; !(ptr2->m_flags & S_END) ; ptr2++)
|
for (ptr2 = keys_settings[i] ; !(ptr2->m_flags & S_END) ; ptr2++)
|
||||||
|
@ -2738,9 +2738,8 @@ boolean M_ParseOption(const char *p, boolean wad)
|
|||||||
// Don't bind movement and turning to mouse wheel. It needs to
|
// Don't bind movement and turning to mouse wheel. It needs to
|
||||||
// be impossible to input a one-frame of movement
|
// be impossible to input a one-frame of movement
|
||||||
// automatically in speedrunning.
|
// automatically in speedrunning.
|
||||||
if ((value == MOUSE_BUTTON_WHEELUP || value == MOUSE_BUTTON_WHEELDOWN ||
|
if (M_IsMouseWheel(value) &&
|
||||||
value == MOUSE_BUTTON_WHEELLEFT || value == MOUSE_BUTTON_WHEELRIGHT) &&
|
dp->ident >= input_forward && dp->ident <= input_straferight)
|
||||||
dp->ident >= input_forward && dp->ident <= input_straferight)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
else if (!M_InputAddMouseB(dp->ident, value))
|
else if (!M_InputAddMouseB(dp->ident, value))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user