Switch SystemControl keys to send press events when toggled on and release events when toggled off.

This fixes the ability to trigger suspend on a mac.

Fixes #607
pull/834/head^2
Jesse Vincent 4 years ago
parent d0be5ab8e0
commit e65044fd64

@ -32,9 +32,9 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) {
if (keyIsPressed(keyState))
Runtime.hid().keyboard().pressConsumerControl(mappedKey);
} else if (mappedKey.getFlags() & IS_SYSCTL) {
if (keyIsPressed(keyState)) {
} else if (keyWasPressed(keyState)) {
if (keyToggledOn(keyState)) {
Runtime.hid().keyboard().pressSystemControl(mappedKey);
} else if (keyToggledOff(keyState)) {
Runtime.hid().keyboard().releaseSystemControl(mappedKey);
}
} else if (mappedKey.getFlags() & IS_INTERNAL) {

Loading…
Cancel
Save