Integrated some changes from 1.2 branch.

This commit is contained in:
crs 2005-01-26 19:01:53 +00:00
parent 42b4e2488a
commit 1bd227922e
3 changed files with 64 additions and 4 deletions

View File

@ -7,6 +7,26 @@
<body class="main"> <body class="main">
<h3>Synergy News</h3> <h3>Synergy News</h3>
<span class="date">Jan-26-2005</span> - Synergy 1.2.2 released
<p>
Made following changes:
</p>
<ul>
<li>Fixed major OS X modifier key handling bug
<li>Fixed handling of ISO_Level3_Shift on X11
</ul>
<span class="date">Jan-04-2005</span> - Synergy 1.2.1 released
<p>
Made following changes:
</p>
<ul>
<li>Fixed major OS X keyboard handling bug
<li>Fixed some minor documentation bugs
</ul>
<span class="date">Dec-30-2004</span> - Synergy 1.2.0 released <span class="date">Dec-30-2004</span> - Synergy 1.2.0 released
<p> <p>

View File

@ -315,8 +315,17 @@ COSXKeyState::mapKey(Keystrokes& keys, KeyID id,
// if the desired mask includes Alt or Control then match the // if the desired mask includes Alt or Control then match the
// desired mask. this ensures that combinations like // desired mask. this ensures that combinations like
// Command+Shift+S use the Command and Shift modifiers and // Command+Shift+S use the Command and Shift modifiers and
// those like Command+S do not use the shift modifier. // those like Command+S do not use the shift modifier. do not
if ((desiredMask & (KeyModifierControl | KeyModifierAlt)) != 0) { // do this if the key to synthesize is a modifier key, otherwise
// we'd apply modifiers to modifiers which breaks things (by
// say, putting a Control press and release around a Control
// press).
if ((desiredMask & (KeyModifierControl | KeyModifierAlt)) != 0 &&
id != kKeyShift_L && id != kKeyShift_R &&
id != kKeyControl_L && id != kKeyControl_R &&
id != kKeyAlt_L && id != kKeyAlt_R &&
id != kKeySuper_L && id != kKeySuper_R &&
id != kKeyMeta_L && id != kKeyMeta_R) {
return addKeystrokes(keys, sequence.back().m_button, return addKeystrokes(keys, sequence.back().m_button,
desiredMask, desiredMask,
KeyModifierShift | KeyModifierSuper | KeyModifierShift | KeyModifierSuper |

View File

@ -414,10 +414,41 @@ CXWindowsKeyState::updateKeysymMap()
} }
// get keysym and get/create key mapping // get keysym and get/create key mapping
const int keycodeIndex = keycode - minKeycode; int keycodeIndex = keycode - minKeycode;
const KeySym keysym = keysyms[keycodeIndex * KeySym keysym = keysyms[keycodeIndex *
keysymsPerKeycode + 0]; keysymsPerKeycode + 0];
// prefer XK_ISO_Level3_Shift over XK_Mode_switch. newer
// versions of X use the former only. we assume here that
// if you have XK_ISO_Level3_Shift mapped then that's what
// you want to use even if XK_Mode_switch is also mapped.
if (j == 0 && keysym == XK_Mode_switch) {
// sort modifiers->modifiermap for this modifier so
// that a keycode mapped to XK_ISO_Level3_Shift appears
// before those mapped to anything else. this one keycode
// is enough so long as it's first because mapModifier in
// CKeyState uses the first keycode in modifierKeys to
// generate the key event for this modifier.
KeyCode* keycodes = modifiers->modifiermap +
i * keysPerModifier + j;
for (unsigned int k = j + 1; k < keysPerModifier; ++k) {
KeySym keysym2 = keysyms[(keycodes[k] - minKeycode) *
keysymsPerKeycode + 0];
if (keysym2 == XK_ISO_Level3_Shift) {
// found an XK_ISO_Level3_Shift. swap it with
// the keycode in index j.
keycodes[j] = keycodes[k];
keycodes[k] = keycode;
// now use the new first keycode
keycode = keycodes[j];
keycodeIndex = keycode - minKeycode;
keysym = keysym2;
break;
}
}
}
// get modifier mask if we haven't yet. this has the side // get modifier mask if we haven't yet. this has the side
// effect of setting the m_*Mask members. // effect of setting the m_*Mask members.
if (mask == 0) { if (mask == 0) {