2024-03-08 13:13:28 +01:00
|
|
|
//
|
|
|
|
// Created by grimmauld on 08.03.24.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SWAYMUX_CLOSESWAYMUXKEYLISTENER_H
|
|
|
|
#define SWAYMUX_CLOSESWAYMUXKEYLISTENER_H
|
|
|
|
|
|
|
|
#include "AbstractKeyListener.h"
|
|
|
|
|
|
|
|
class CloseSwaymuxKeyListener : public AbstractKeyListener {
|
|
|
|
public:
|
|
|
|
void handleKeyEvent(const QKeyEvent *keyEvent) const override {
|
|
|
|
QApplication::quit();
|
|
|
|
}
|
|
|
|
|
2024-03-13 21:43:57 +01:00
|
|
|
const std::string getDescription() override {
|
2024-03-08 13:13:28 +01:00
|
|
|
return "Exit Swaymux";
|
|
|
|
}
|
|
|
|
|
2024-03-13 21:43:57 +01:00
|
|
|
const std::string getKeyText() override {
|
2024-03-08 13:13:28 +01:00
|
|
|
return "ESC";
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]] bool canAcceptKey(int key) const override {
|
|
|
|
return key == Qt::Key_Escape;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //SWAYMUX_CLOSESWAYMUXKEYLISTENER_H
|