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
34
src/wayland/hyprland/global_shortcuts/manager.hpp
Normal file
34
src/wayland/hyprland/global_shortcuts/manager.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qhash.h>
|
||||
#include <qstring.h>
|
||||
#include <qwayland-hyprland-global-shortcuts-v1.h>
|
||||
#include <qwaylandclientextension.h>
|
||||
|
||||
#include "shortcut.hpp"
|
||||
|
||||
namespace qs::hyprland::global_shortcuts::impl {
|
||||
|
||||
class GlobalShortcutManager
|
||||
: public QWaylandClientExtensionTemplate<GlobalShortcutManager>
|
||||
, public QtWayland::hyprland_global_shortcuts_manager_v1 {
|
||||
public:
|
||||
explicit GlobalShortcutManager();
|
||||
|
||||
GlobalShortcut* registerShortcut(
|
||||
const QString& appid,
|
||||
const QString& name,
|
||||
const QString& description,
|
||||
const QString& triggerDescription
|
||||
);
|
||||
|
||||
void unregisterShortcut(const QString& appid, const QString& name);
|
||||
|
||||
static GlobalShortcutManager* instance();
|
||||
|
||||
private:
|
||||
QHash<QPair<QString, QString>, QPair<qint32, GlobalShortcut*>> shortcuts;
|
||||
};
|
||||
|
||||
} // namespace qs::hyprland::global_shortcuts::impl
|
||||
Loading…
Add table
Add a link
Reference in a new issue