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