mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:50:06 +00:00
43 lines
714 B
C++
43 lines
714 B
C++
#pragma once
|
|
|
|
#include <scwx/qt/types/hotkey_types.hpp>
|
|
|
|
#include <memory>
|
|
|
|
#include <QObject>
|
|
|
|
class QKeyEvent;
|
|
|
|
namespace scwx
|
|
{
|
|
namespace qt
|
|
{
|
|
namespace manager
|
|
{
|
|
|
|
class HotkeyManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_DISABLE_COPY_MOVE(HotkeyManager)
|
|
|
|
public:
|
|
explicit HotkeyManager();
|
|
~HotkeyManager();
|
|
|
|
bool HandleKeyPress(QKeyEvent* event);
|
|
bool HandleKeyRelease(QKeyEvent* event);
|
|
|
|
static std::shared_ptr<HotkeyManager> Instance();
|
|
|
|
signals:
|
|
void HotkeyPressed(scwx::qt::types::Hotkey hotkey, bool isAutoRepeat);
|
|
void HotkeyReleased(scwx::qt::types::Hotkey hotkey);
|
|
|
|
private:
|
|
class Impl;
|
|
std::unique_ptr<Impl> p;
|
|
};
|
|
|
|
} // namespace manager
|
|
} // namespace qt
|
|
} // namespace scwx
|