mirror of
https://github.com/Skycoder42/QHotkey.git
synced 2026-11-19 12:49:58 +03:00
modified native hotkey to allow 0 as valid key
This commit is contained in:
+19
-1
@@ -19,7 +19,22 @@ class QHotkey : public QObject
|
||||
|
||||
public:
|
||||
//! Defines shortcut with native keycodes
|
||||
typedef QPair<quint32, quint32> NativeShortcut;
|
||||
class NativeShortcut {
|
||||
public:
|
||||
quint32 key;
|
||||
quint32 modifier;
|
||||
|
||||
NativeShortcut();
|
||||
NativeShortcut(quint32 key, quint32 modifier = 0);
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
bool operator ==(const NativeShortcut &other) const;
|
||||
bool operator !=(const NativeShortcut &other) const;
|
||||
|
||||
private:
|
||||
bool valid;
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
explicit QHotkey(QObject *parent = Q_NULLPTR);
|
||||
@@ -65,6 +80,9 @@ private:
|
||||
bool registered;
|
||||
};
|
||||
|
||||
uint qHash(const QHotkey::NativeShortcut &key);
|
||||
uint qHash(const QHotkey::NativeShortcut &key, uint seed);
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(logQHotkey)
|
||||
|
||||
#endif // QHOTKEY_H
|
||||
|
||||
Reference in New Issue
Block a user