added native shortcut support (win)

This commit is contained in:
Skycoder42
2016-12-04 16:49:53 +01:00
parent 5cc4b7bf2d
commit 686abe219a
5 changed files with 347 additions and 41 deletions
+7
View File
@@ -42,6 +42,8 @@ public:
explicit QHotkey(const QKeySequence &shortcut, bool autoRegister = false, QObject *parent = Q_NULLPTR);
//! Constructs a hotkey with a key and modifiers and optionally registers it
explicit QHotkey(Qt::Key key, Qt::KeyboardModifiers modifiers, bool autoRegister = false, QObject *parent = Q_NULLPTR);
//! Constructs a hotkey from a native shortcut and optionally registers it
explicit QHotkey(const NativeShortcut &shortcut, bool autoRegister = false, QObject *parent = Q_NULLPTR);
//! Destructor
~QHotkey();
@@ -54,6 +56,9 @@ public:
//! READ-Accessor for QHotkey::shortcut - the modifiers only
Qt::KeyboardModifiers modifiers() const;
// Get the current native shortcut
NativeShortcut currentNativeShortcut() const;
public slots:
//! WRITE-Accessor for QHotkey::registered
bool setRegistered(bool registered);
@@ -65,6 +70,8 @@ public slots:
//! RESET-Accessor for QHotkey::shortcut
bool resetShortcut();
bool setNativeShortcut(NativeShortcut nativeShortcut, bool autoRegister = false);
signals:
//! Will be emitted if the shortcut is pressed
void activated(QPrivateSignal);