From 21283023070e92d92e7647944182b29aedea219d Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 15 Dec 2002 20:00:52 +0000 Subject: [PATCH] Fixed loss of ctrl+alt when transmitted to non-windows platforms from a windows server. Was converting ctrl+alt on windows to mode switch on the server. No longer doing that; windows clients will interpret ctrl+alt as AltGr and other clients will just see ctrl+alt. Also made the right alt key mode switch on windows servers in case the user wants to force a mode switch, but that means the right alt key no longer acts as alt on clients. --- lib/server/CMSWindowsPrimaryScreen.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/server/CMSWindowsPrimaryScreen.cpp b/lib/server/CMSWindowsPrimaryScreen.cpp index 05188335..d6b96cc6 100644 --- a/lib/server/CMSWindowsPrimaryScreen.cpp +++ b/lib/server/CMSWindowsPrimaryScreen.cpp @@ -902,9 +902,12 @@ CMSWindowsPrimaryScreen::mapKey( m_keys[VK_CONTROL]) & 0x80) != 0) { mask |= KeyModifierControl; } - if (((m_keys[VK_LMENU] | - m_keys[VK_RMENU] | - m_keys[VK_MENU]) & 0x80) != 0) { + if ((m_keys[VK_RMENU] & 0x80) != 0) { + // right alt => AltGr on windows + mask |= KeyModifierModeSwitch; + } + else if (((m_keys[VK_LMENU] | + m_keys[VK_MENU]) & 0x80) != 0) { mask |= KeyModifierAlt; } if (((m_keys[VK_LWIN] | @@ -920,12 +923,19 @@ CMSWindowsPrimaryScreen::mapKey( if ((m_keys[VK_SCROLL] & 0x01) != 0) { mask |= KeyModifierScrollLock; } + // ctrl+alt => AltGr on windows +/* don't convert ctrl+alt to mode switch. if we do that then we can + * never send ctrl+alt+[key] from windows to some platform that + * doesn't treat ctrl+alt as mode switch (i.e. all other platforms). + * instead, let windows clients automatically treat ctrl+alt as + * AltGr and let other clients use ctrl+alt as is. the right alt + * key serves as a mode switch key. if ((mask & (KeyModifierControl | KeyModifierAlt)) == (KeyModifierControl | KeyModifierAlt)) { - // ctrl+alt => AltGr on windows mask |= KeyModifierModeSwitch; mask &= ~(KeyModifierControl | KeyModifierAlt); } +*/ *maskOut = mask; LOG((CLOG_DEBUG2 "key in vk=%d info=0x%08x mask=0x%04x", vkCode, info, mask));