added more mods

This commit is contained in:
vaxerski 2021-11-23 17:00:47 +01:00
parent 4ddc5fdb3a
commit e23ac83c49
3 changed files with 13 additions and 1 deletions

View file

@ -60,6 +60,12 @@ unsigned int KeybindManager::modToMask(MODS mod) {
return XCB_MOD_MASK_SHIFT; return XCB_MOD_MASK_SHIFT;
case MOD_SHIFTSUPER: case MOD_SHIFTSUPER:
return XCB_MOD_MASK_4 | XCB_MOD_MASK_SHIFT; return XCB_MOD_MASK_4 | XCB_MOD_MASK_SHIFT;
case MOD_SHIFTCTRL:
return XCB_MOD_MASK_SHIFT | XCB_MOD_MASK_CONTROL;
case MOD_CTRL:
return XCB_MOD_MASK_CONTROL;
case MOD_CTRLSUPER:
return XCB_MOD_MASK_CONTROL | XCB_MOD_MASK_4;
} }
return 0; return 0;

View file

@ -51,6 +51,9 @@ void handleBind(const std::string& command, const std::string& value) {
if (MOD == "SUPER") mod = MOD_SUPER; if (MOD == "SUPER") mod = MOD_SUPER;
else if (MOD == "SHIFT") mod = MOD_SHIFT; else if (MOD == "SHIFT") mod = MOD_SHIFT;
else if (MOD == "SUPERSHIFT" || MOD == "SHIFTSUPER") mod = MOD_SHIFTSUPER; else if (MOD == "SUPERSHIFT" || MOD == "SHIFTSUPER") mod = MOD_SHIFTSUPER;
else if (MOD == "SUPERCTRL" || MOD == "CTRLSUPER") mod = MOD_CTRLSUPER;
else if (MOD == "CTRL") mod = MOD_CTRL;
else if (MOD == "CTRLSHIFT" || MOD == "SHIFTCTRL") mod = MOD_SHIFTCTRL;
Dispatcher dispatcher = nullptr; Dispatcher dispatcher = nullptr;
if (HANDLER == "exec") dispatcher = KeybindManager::call; if (HANDLER == "exec") dispatcher = KeybindManager::call;

View file

@ -7,7 +7,10 @@ enum MODS {
MOD_NONE = 0, MOD_NONE = 0,
MOD_SUPER, MOD_SUPER,
MOD_SHIFT, MOD_SHIFT,
MOD_SHIFTSUPER MOD_SHIFTSUPER,
MOD_SHIFTCTRL,
MOD_CTRL,
MOD_CTRLSUPER
}; };
class Keybind { class Keybind {