2022-03-19 17:48:18 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
|
|
|
#include <deque>
|
|
|
|
#include "../Compositor.hpp"
|
|
|
|
|
|
|
|
struct SKeybind {
|
|
|
|
std::string key = 0;
|
|
|
|
uint32_t modmask = 0;
|
|
|
|
std::string handler = "";
|
|
|
|
std::string arg = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
class CKeybindManager {
|
|
|
|
public:
|
2022-03-19 22:03:40 +01:00
|
|
|
bool handleKeybinds(const uint32_t&, const xkb_keysym_t&);
|
2022-03-19 17:48:18 +01:00
|
|
|
void addKeybind(SKeybind);
|
|
|
|
uint32_t stringToModMask(std::string);
|
2022-03-19 21:48:24 +01:00
|
|
|
void clearKeybinds();
|
2022-03-19 17:48:18 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::deque<SKeybind> m_dKeybinds;
|
|
|
|
|
2022-03-27 19:32:50 +02:00
|
|
|
bool handleInternalKeybinds(xkb_keysym_t);
|
2022-03-19 17:48:18 +01:00
|
|
|
|
|
|
|
// -------------- Dispatchers -------------- //
|
|
|
|
void killActive(std::string);
|
|
|
|
void spawn(std::string);
|
2022-03-20 11:14:24 +01:00
|
|
|
void toggleActiveFloating(std::string);
|
2022-04-02 20:04:32 +02:00
|
|
|
void toggleActivePseudo(std::string);
|
2022-03-20 15:55:47 +01:00
|
|
|
void changeworkspace(std::string);
|
2022-03-21 19:18:33 +01:00
|
|
|
void fullscreenActive(std::string);
|
2022-03-23 16:51:48 +01:00
|
|
|
void moveActiveToWorkspace(std::string);
|
2022-04-09 13:26:55 +02:00
|
|
|
void moveFocusTo(std::string);
|
2022-04-20 16:18:58 +02:00
|
|
|
void moveActiveTo(std::string);
|
2022-04-12 16:44:18 +02:00
|
|
|
void toggleGroup(std::string);
|
|
|
|
void changeGroupActive(std::string);
|
2022-04-20 16:53:41 +02:00
|
|
|
void alterSplitRatio(std::string);
|
2022-03-19 17:48:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
inline std::unique_ptr<CKeybindManager> g_pKeybindManager;
|