- Make screenjob valid keys for skipping ignore the Alt key as its used for modifiers, and special keys like the screenshot bind.

* Partially revert 8bb13bc4c2 as its changes are no longer needed.
* Partially revert 9e40e49c2c as its changes are no longer needed.
* Fixes #577.
This commit is contained in:
Mitch Richters 2021-11-18 20:59:07 +11:00
parent 719724da53
commit 4d629e7de8
3 changed files with 6 additions and 32 deletions

View file

@ -80,32 +80,14 @@ 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;
// 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)
if (state && !(key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT))
AnyKeyStatus = true;
}
}

View file

@ -127,14 +127,3 @@ inline void resetForcedSyncInput()
{
gamesetinput = false;
}
inline bool specialKeyEvent(event_t* ev)
{
if (ev->type == EV_KeyDown || ev->type == EV_KeyUp)
{
int key = ev->data1;
if (key == KEY_VOLUMEDOWN || key == KEY_VOLUMEUP || (key > KEY_LASTJOYBUTTON && key < KEY_PAD_LTHUMB_RIGHT)) return true;
}
return false;
}

View file

@ -200,11 +200,14 @@ struct System native
if (ev.type == InputEvent.Type_KeyDown || ev.type == InputEvent.Type_KeyUp)
{
int key = ev.KeyScan;
if (key == InputEvent.KEY_VOLUMEDOWN || key == InputEvent.KEY_VOLUMEUP || (key > InputEvent.KEY_LASTJOYBUTTON && key < InputEvent.KEY_PAD_LTHUMB_RIGHT)) return true;
let binding = Bindings.GetBinding(key);
bool volumekeys = key == InputEvent.KEY_VOLUMEDOWN || key == InputEvent.KEY_VOLUMEUP;
bool gamepadkeys = key > InputEvent.KEY_LASTJOYBUTTON && key < InputEvent.KEY_PAD_LTHUMB_RIGHT;
bool altkeys = key == InputEvent.KEY_LALT || key == InputEvent.KEY_RALT;
if (volumekeys || gamepadkeys || altkeys || binding ~== "screenshot") return true;
}
return false;
}
}
struct MusPlayingInfo native