30 lines
641 B
C
30 lines
641 B
C
|
//
|
||
|
// 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();
|
||
|
}
|
||
|
|
||
|
std::string getDescription() override {
|
||
|
return "Exit Swaymux";
|
||
|
}
|
||
|
|
||
|
std::string getKeyText() override {
|
||
|
return "ESC";
|
||
|
}
|
||
|
|
||
|
[[nodiscard]] bool canAcceptKey(int key) const override {
|
||
|
return key == Qt::Key_Escape;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif //SWAYMUX_CLOSESWAYMUXKEYLISTENER_H
|