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 
pull/834/head^2
Jesse Vincent 5 years ago
parent d0be5ab8e0
commit e65044fd64

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

Loading…
Cancel
Save