| 669 | } |
| 670 | |
| 671 | const KeyMap::KeyItem *KeyMap::keyForModifier(KeyButton button, int32_t group, int32_t modifierBit) const |
| 672 | { |
| 673 | assert(modifierBit >= 0 && modifierBit < kKeyModifierNumBits); |
| 674 | assert(group >= 0 && group < getNumGroups()); |
| 675 | |
| 676 | // find a key that generates the given modifier in the given group |
| 677 | // but doesn't use the given button, presumably because we're trying |
| 678 | // to generate a KeyID that's only bound the the given button. |
| 679 | // this is important when a shift button is modified by shift; we |
| 680 | // must use the other shift button to do the shifting. |
| 681 | const ModifierKeyItemList &items = m_modifierKeys[group * kKeyModifierNumBits + modifierBit]; |
| 682 | for (const auto &item : items) { |
| 683 | if (item->m_button != button) { |
| 684 | return item; |
| 685 | } |
| 686 | } |
| 687 | return nullptr; |
| 688 | } |
| 689 | |
| 690 | bool KeyMap::keysForKeyItem( |
| 691 | const KeyItem &keyItem, int32_t &group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, |
nothing calls this directly
no outgoing calls
no test coverage detected