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.
This commit is contained in:
crs 2002-12-15 20:00:52 +00:00
parent 773fcae8b3
commit 2128302307
1 changed files with 14 additions and 4 deletions

View File

@ -902,8 +902,11 @@ CMSWindowsPrimaryScreen::mapKey(
m_keys[VK_CONTROL]) & 0x80) != 0) { m_keys[VK_CONTROL]) & 0x80) != 0) {
mask |= KeyModifierControl; mask |= KeyModifierControl;
} }
if (((m_keys[VK_LMENU] | if ((m_keys[VK_RMENU] & 0x80) != 0) {
m_keys[VK_RMENU] | // right alt => AltGr on windows
mask |= KeyModifierModeSwitch;
}
else if (((m_keys[VK_LMENU] |
m_keys[VK_MENU]) & 0x80) != 0) { m_keys[VK_MENU]) & 0x80) != 0) {
mask |= KeyModifierAlt; mask |= KeyModifierAlt;
} }
@ -920,12 +923,19 @@ CMSWindowsPrimaryScreen::mapKey(
if ((m_keys[VK_SCROLL] & 0x01) != 0) { if ((m_keys[VK_SCROLL] & 0x01) != 0) {
mask |= KeyModifierScrollLock; 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)) == if ((mask & (KeyModifierControl | KeyModifierAlt)) ==
(KeyModifierControl | KeyModifierAlt)) { (KeyModifierControl | KeyModifierAlt)) {
// ctrl+alt => AltGr on windows
mask |= KeyModifierModeSwitch; mask |= KeyModifierModeSwitch;
mask &= ~(KeyModifierControl | KeyModifierAlt); mask &= ~(KeyModifierControl | KeyModifierAlt);
} }
*/
*maskOut = mask; *maskOut = mask;
LOG((CLOG_DEBUG2 "key in vk=%d info=0x%08x mask=0x%04x", vkCode, info, mask)); LOG((CLOG_DEBUG2 "key in vk=%d info=0x%08x mask=0x%04x", vkCode, info, mask));