hyprland/global_shortcuts: add GlobalShortcut

This commit is contained in:
outfoxxed 2024-05-06 22:05:46 -07:00
parent 87a884ca36
commit bba8cb8a7d
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
14 changed files with 569 additions and 6 deletions

View file

@ -0,0 +1,33 @@
#include "shortcut.hpp"
#include <qtmetamacros.h>
#include <qtypes.h>
#include <wayland-hyprland-global-shortcuts-v1-client-protocol.h>
namespace qs::hyprland::global_shortcuts::impl {
GlobalShortcut::GlobalShortcut(::hyprland_global_shortcut_v1* shortcut) { this->init(shortcut); }
GlobalShortcut::~GlobalShortcut() {
if (this->isInitialized()) {
this->destroy();
}
}
void GlobalShortcut::hyprland_global_shortcut_v1_pressed(
quint32 /*unused*/,
quint32 /*unused*/,
quint32 /*unused*/
) {
emit this->pressed();
}
void GlobalShortcut::hyprland_global_shortcut_v1_released(
quint32 /*unused*/,
quint32 /*unused*/,
quint32 /*unused*/
) {
emit this->released();
}
} // namespace qs::hyprland::global_shortcuts::impl