From 67f14da6910e226153e5f91befa6b5e9b1994e9e Mon Sep 17 00:00:00 2001 From: "Xinyu Hou (Jerry)" Date: Tue, 14 Jun 2016 12:08:07 +0100 Subject: [PATCH] #3305 Added brightness up and down support --- src/lib/platform/XWindowsScreen.cpp | 10 +++++++++- src/lib/platform/XWindowsUtil.cpp | 4 ++-- src/lib/synergy/key_types.h | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 7579f66f..218e48f8 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -1475,6 +1475,7 @@ XWindowsScreen::onKeyPress(XKeyEvent& xkey) keycode = static_cast(m_lastKeycode); if (keycode == 0) { // no keycode + LOG((CLOG_DEBUG1 "event: KeyPress no keycode")); return; } } @@ -1489,6 +1490,9 @@ XWindowsScreen::onKeyPress(XKeyEvent& xkey) false, false, key, mask, 1, keycode); } } + else { + LOG((CLOG_DEBUG1 "can't map keycode to key id")); + } } void @@ -1862,8 +1866,12 @@ XWindowsScreen::mapKeyFromX(XKeyEvent* event) const XLookupString(event, dummy, 0, &keysym, NULL); } + LOG((CLOG_DEBUG2 "mapped code=%d to keysym=0x%04x", event->keycode, keysym)); + // convert key - return XWindowsUtil::mapKeySymToKeyID(keysym); + KeyID result = CXWindowsUtil::mapKeySymToKeyID(keysym); + LOG((CLOG_DEBUG2 "mapped keysym=0x%04x to keyID=%d", keysym, result)); + return result; } ButtonID diff --git a/src/lib/platform/XWindowsUtil.cpp b/src/lib/platform/XWindowsUtil.cpp index 6b016d21..6b9f4dab 100644 --- a/src/lib/platform/XWindowsUtil.cpp +++ b/src/lib/platform/XWindowsUtil.cpp @@ -1250,7 +1250,7 @@ XK_uhorn // map "Internet" keys to KeyIDs static const KeySym s_map1008FF[] = { - /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, + /* 0x00 */ 0, 0, kKeyBrightnessUp, kKeyBrightnessDown, 0, 0, 0, 0, /* 0x08 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */ 0, kKeyAudioDown, kKeyAudioMute, kKeyAudioUp, /* 0x14 */ kKeyAudioPlay, kKeyAudioStop, kKeyAudioPrev, kKeyAudioNext, @@ -1260,7 +1260,7 @@ static const KeySym s_map1008FF[] = /* 0x30 */ kKeyWWWFavorites, 0, kKeyAppMedia, 0, 0, 0, 0, 0, /* 0x38 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */ kKeyAppUser1, kKeyAppUser2, 0, 0, 0, 0, 0, 0, - /* 0x48 */ 0, 0, 0, 0, 0, 0, 0, 0, + /* 0x48 */ 0, 0, kKeyExposeDesktop, kKeyExposeApp, 0, 0, 0, 0, /* 0x50 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */ 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/lib/synergy/key_types.h b/src/lib/synergy/key_types.h index 71d19591..b02d80e0 100644 --- a/src/lib/synergy/key_types.h +++ b/src/lib/synergy/key_types.h @@ -280,6 +280,10 @@ static const KeyID kKeyAppMail = 0xE0B4; static const KeyID kKeyAppMedia = 0xE0B5; static const KeyID kKeyAppUser1 = 0xE0B6; static const KeyID kKeyAppUser2 = 0xE0B7; +static const KeyID kKeyBrightnessDown = 0xE0B8; +static const KeyID kKeyBrightnessUp = 0xE0B9; +static const KeyID kKeyExposeDesktop = 0xE0C0; +static const KeyID kKeyExposeApp = 0xE0C1; //@}