forked from quickshell/quickshell
hyprland/global_shortcuts: add GlobalShortcut
This commit is contained in:
parent
87a884ca36
commit
bba8cb8a7d
14 changed files with 569 additions and 6 deletions
32
src/wayland/hyprland/global_shortcuts/shortcut.hpp
Normal file
32
src/wayland/hyprland/global_shortcuts/shortcut.hpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qtclasshelpermacros.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
#include <qwayland-hyprland-global-shortcuts-v1.h>
|
||||
|
||||
namespace qs::hyprland::global_shortcuts::impl {
|
||||
|
||||
class GlobalShortcut
|
||||
: public QObject
|
||||
, public QtWayland::hyprland_global_shortcut_v1 {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
explicit GlobalShortcut(::hyprland_global_shortcut_v1* shortcut);
|
||||
~GlobalShortcut() override;
|
||||
Q_DISABLE_COPY_MOVE(GlobalShortcut);
|
||||
|
||||
signals:
|
||||
void pressed();
|
||||
void released();
|
||||
|
||||
private:
|
||||
// clang-format off
|
||||
void hyprland_global_shortcut_v1_pressed(quint32 tvSecHi, quint32 tvSecLo, quint32 tvNsec) override;
|
||||
void hyprland_global_shortcut_v1_released(quint32 tvSecHi, quint32 tvSecLo, quint32 tvNsec) override;
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
} // namespace qs::hyprland::global_shortcuts::impl
|
Loading…
Add table
Add a link
Reference in a new issue