#pragma once #include #include #include 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 Instance(); signals: void HotkeyPressed(scwx::qt::types::Hotkey hotkey, bool isAutoRepeat); void HotkeyReleased(scwx::qt::types::Hotkey hotkey); private: class Impl; std::unique_ptr p; }; } // namespace manager } // namespace qt } // namespace scwx