#3305 Made Mac clients aware of brightness keys

This commit is contained in:
Jerry (Xinyu Hou) 2016-06-16 15:31:00 +00:00 committed by Andrew Nelless
parent 67f14da691
commit ab4f59eac4
2 changed files with 22 additions and 12 deletions

View File

@ -21,6 +21,8 @@ int convertKeyIDToNXKeyType(KeyID id)
// hidsystem/ev_keymap.h
// NX_KEYTYPE_SOUND_UP 0
// NX_KEYTYPE_SOUND_DOWN 1
// NX_KEYTYPE_BRIGHTNESS_UP 2
// NX_KEYTYPE_BRIGHTNESS_DOWN 3
// NX_KEYTYPE_MUTE 7
// NX_KEYTYPE_EJECT 14
// NX_KEYTYPE_PLAY 16
@ -37,6 +39,12 @@ int convertKeyIDToNXKeyType(KeyID id)
case kKeyAudioDown:
type = 1;
break;
case kKeyBrightnessUp:
type = 2;
break;
case kKeyBrightnessDown:
type = 3;
break;
case kKeyAudioMute:
type = 7;
break;

View File

@ -573,10 +573,12 @@ KeyState::fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton serverID)
if (keyItem == NULL) {
// a media key won't be mapped on mac, so we need to fake it in a
// special way
if (id == kKeyAudioDown || id == kKeyAudioUp || id == kKeyAudioMute ||
if (id == kKeyAudioDown || id == kKeyAudioUp ||
id == kKeyAudioMute || id == kKeyAudioPlay ||
id == kKeyAudioPrev || id == kKeyAudioNext ||
id == kKeyAudioPlay) {
LOG((CLOG_DEBUG "emulating media key"));
id == kKeyBrightnessDown || id == kKeyBrightnessUp
) {
LOG((CLOG_DEBUG1 "emulating media key"));
fakeMediaKey(id);
}