Warn if multiple keys are bound to a key on removal

This commit is contained in:
Emma Broman
2020-10-09 18:52:38 +02:00
parent 37c45a10b6
commit ec1fbb09f8
4 changed files with 33 additions and 7 deletions
+8 -2
View File
@@ -156,11 +156,17 @@ void KeybindingManager::removeKeyBinding(const KeyWithModifier& key) {
std::vector<std::pair<KeyWithModifier, KeybindingManager::KeyInformation>>
KeybindingManager::keyBinding(const std::string& key) const
{
KeyWithModifier k = stringToKey(key);
return keyBinding(k);
}
std::vector<std::pair<KeyWithModifier, KeybindingManager::KeyInformation>>
KeybindingManager::keyBinding(const KeyWithModifier& key) const
{
std::vector<std::pair<KeyWithModifier, KeyInformation>> result;
KeyWithModifier k = stringToKey(key);
auto itRange = _keyLua.equal_range(k);
auto itRange = _keyLua.equal_range(key);
for (auto it = itRange.first; it != itRange.second; ++it) {
result.emplace_back(it->first, it->second);
}