- InputState::AddEvent(): Partially revert changes performed in 4d629e7de8 that were believed not necessary. This functionality is still needed in some of Exhumed's cutscenes that are performed in-engine and not as a screenjob.

This commit is contained in:
Mitch Richters 2021-11-19 08:11:32 +11:00
parent 4d629e7de8
commit 1228cb6044

View file

@ -80,14 +80,32 @@ void InputState::GetMouseDelta(ControlInfo * hidInput)
//
//==========================================================================
static int exclKeys[] = { KEY_VOLUMEDOWN, KEY_VOLUMEUP };
void InputState::AddEvent(const event_t *ev)
{
if (ev->type == EV_KeyDown || ev->type == EV_KeyUp)
{
int key = ev->data1;
bool state = ev->type == EV_KeyDown;
bool ignore = false;
KeyStatus[key] = (uint8_t)state;
if (state && !(key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT))
// Check if key is to be excluded from setting AnyKeyStatus.
for (int i = 0; i < 2; i++)
{
if (exclKeys[i] == key)
{
ignore = true;
break;
}
}
if (key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT)
{
ignore = true;
}
if (state && !ignore)
AnyKeyStatus = true;
}
}