mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-24 06:15:57 +01:00
I am an idiot, keysym fix
This commit is contained in:
parent
245712664e
commit
1898839d4c
2 changed files with 8 additions and 3 deletions
|
@ -21,8 +21,13 @@ uint32_t KeybindManager::getKeyCodeFromName(std::string name) {
|
||||||
if (name == "")
|
if (name == "")
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (name.find_first_not_of("1234567890") == std::string::npos)
|
if (name.find_first_not_of("1234567890") == std::string::npos) {
|
||||||
|
const auto KC = std::stoi(name);
|
||||||
|
|
||||||
|
if (KC > 10) // 0-9 are OK for parsing they are on the KB
|
||||||
return std::stoi(name);
|
return std::stoi(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const auto ORIGINALCASENAME = name;
|
const auto ORIGINALCASENAME = name;
|
||||||
transform(name.begin(), name.end(), name.begin(), ::tolower);
|
transform(name.begin(), name.end(), name.begin(), ::tolower);
|
||||||
|
|
|
@ -780,7 +780,7 @@ void Events::eventKeyPress(xcb_generic_event_t* event) {
|
||||||
const auto IGNOREDMOD = KeybindManager::modToMask(ConfigManager::getString("ignore_mod"));
|
const auto IGNOREDMOD = KeybindManager::modToMask(ConfigManager::getString("ignore_mod"));
|
||||||
|
|
||||||
for (auto& keybind : KeybindManager::keybinds) {
|
for (auto& keybind : KeybindManager::keybinds) {
|
||||||
if (keybind.getKeysym() != 0 && keybind.getKeysym() == KEYSYM && (keybind.getMod() == E->state || ((keybind.getMod() | IGNOREDMOD) == E->state))) {
|
if (keybind.getKeysym() != 0 && keybind.getKeysym() == KEYSYM && ((keybind.getMod() == E->state) || ((keybind.getMod() | IGNOREDMOD) == E->state))) {
|
||||||
keybind.getDispatcher()(keybind.getCommand());
|
keybind.getDispatcher()(keybind.getCommand());
|
||||||
return;
|
return;
|
||||||
// TODO: fix duplicating keybinds
|
// TODO: fix duplicating keybinds
|
||||||
|
|
Loading…
Reference in a new issue