Fixed dead key and AltGr+shift handling on X windows. Also fixed

bug with decomposing characters that have no direct key mapping
but do have a direct key mapping for the character with the opposite
case.
This commit is contained in:
crs
2004-10-24 18:18:01 +00:00
parent 9f6c8f937a
commit f65d53d06a
3 changed files with 78 additions and 59 deletions

View File

@@ -295,7 +295,7 @@ CKeyState::addModifier(KeyModifierMask modifier, const KeyButtons& buttons)
bool
CKeyState::mapModifier(Keystrokes& keys, Keystrokes& undo,
KeyModifierMask mask, bool desireActive) const
KeyModifierMask mask, bool desireActive, bool force) const
{
// look up modifier
const KeyButtons& buttons = m_maskToKeys[getIndexForModifier(mask)];
@@ -304,7 +304,7 @@ CKeyState::mapModifier(Keystrokes& keys, Keystrokes& undo,
}
// ignore if already in desired state
if (isModifierActive(mask) == desireActive) {
if (!force && isModifierActive(mask) == desireActive) {
return true;
}

View File

@@ -102,16 +102,19 @@ protected:
//! Get key events to change modifier state
/*!
Retrieves the key events necessary to activate (\c desireActive is true)
or deactivate (\c desireActive is false) the modifier given by \c mask
by pushing them onto the back of \c keys. \c mask must specify exactly
one modifier. \c undo receives the key events necessary to restore the
modifier's previous state. They're pushed onto \c undo in the reverse
order they should be executed. Returns true if the modifier can be
adjusted, false otherwise.
Retrieves the key events necessary to activate (\p desireActive is true)
or deactivate (\p desireActive is false) the modifier given by \p mask
by pushing them onto the back of \p keys. \p mask must specify exactly
one modifier. \p undo receives the key events necessary to restore the
modifier's previous state. They're pushed onto \p undo in the reverse
order they should be executed. If \p force is false then \p keys and
\p undo are only changed if the modifier is not currently in the
desired state. If \p force is true then \p keys and \p undo are always
changed. Returns true if the modifier can be adjusted, false otherwise.
*/
bool mapModifier(Keystrokes& keys, Keystrokes& undo,
KeyModifierMask mask, bool desireActive) const;
KeyModifierMask mask, bool desireActive,
bool force = false) const;
//! Update the key state
/*!