diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-27 13:42:20 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-27 13:42:20 +0200 |
| commit | 781526dac58619fa313ca9bf86bfd712c01cb68f (patch) | |
| tree | 93139652439c65fc49b66437292dacb4c2efb258 /src/managers/KeybindManager.cpp | |
| parent | b9a5fc0d2f76718833b49ec01234496f5002a677 (diff) | |
added hyprctl kill
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 10694e1b..aab79458 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -108,7 +108,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const xkb_keysym_t return found; } -bool CKeybindManager::handleInternalKeybinds(xkb_keysym_t keysym) { +bool CKeybindManager::handleVT(xkb_keysym_t keysym) { // Handles the CTRL+ALT+FX TTY keybinds if (!(keysym >= XKB_KEY_XF86Switch_VT_1 && keysym <= XKB_KEY_XF86Switch_VT_12)) return false; @@ -119,19 +119,36 @@ bool CKeybindManager::handleInternalKeybinds(xkb_keysym_t keysym) { wlr_session_change_vt(PSESSION, TTY); for (auto& m : g_pCompositor->m_lMonitors) { - g_pHyprOpenGL->destroyMonitorResources(&m); // mark resources as unusable anymore + g_pHyprOpenGL->destroyMonitorResources(&m); // mark resources as unusable anymore m.noFrameSchedule = true; m.framesToSkip = 2; } Debug::log(LOG, "Switched to VT %i, destroyed all render data, frames to skip for each: 2", TTY); - + return true; } return false; } +bool CKeybindManager::handleInternalKeybinds(xkb_keysym_t keysym) { + if (handleVT(keysym)) + return true; + + // handle ESC while in kill mode + if (g_pInputManager->getClickMode() == CLICKMODE_KILL) { + const auto KBKEY = xkb_keysym_from_name("ESCAPE", XKB_KEYSYM_CASE_INSENSITIVE); + + if (keysym == KBKEY) { + g_pInputManager->setClickMode(CLICKMODE_DEFAULT); + return true; + } + } + + return false; +} + // Dispatchers void CKeybindManager::spawn(std::string args) { |
