mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-29 15:05:59 +01:00
added keycode support to unbind
This commit is contained in:
parent
cd0a01f4de
commit
46306e59eb
1 changed files with 14 additions and 1 deletions
|
@ -41,8 +41,21 @@ void CKeybindManager::addKeybind(SKeybind kb) {
|
||||||
|
|
||||||
void CKeybindManager::removeKeybind(uint32_t mod, const std::string& key) {
|
void CKeybindManager::removeKeybind(uint32_t mod, const std::string& key) {
|
||||||
for (auto it = m_lKeybinds.begin(); it != m_lKeybinds.end(); ++it) {
|
for (auto it = m_lKeybinds.begin(); it != m_lKeybinds.end(); ++it) {
|
||||||
if (it->modmask == mod && it->key == key) {
|
if (isNumber(key) && std::stoi(key) > 9) {
|
||||||
|
const auto KEYNUM = std::stoi(key);
|
||||||
|
|
||||||
|
if (it->modmask == mod && it->keycode == KEYNUM) {
|
||||||
it = m_lKeybinds.erase(it);
|
it = m_lKeybinds.erase(it);
|
||||||
|
|
||||||
|
if (it == m_lKeybinds.end())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (it->modmask == mod && it->key == key) {
|
||||||
|
it = m_lKeybinds.erase(it);
|
||||||
|
|
||||||
|
if (it == m_lKeybinds.end())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue