9#ifndef KSHORTCUTRECORDER_H
10#define KSHORTCUTRECORDER_H
12#include <kguiaddons_export.h>
14#include <QKeySequence>
20class KeySequenceRecorderPrivate;
48 Q_PROPERTY(
bool isRecording READ isRecording NOTIFY recordingChanged)
57 Q_PROPERTY(QKeySequence currentKeySequence READ currentKeySequence WRITE setCurrentKeySequence NOTIFY currentKeySequenceChanged)
61 Q_PROPERTY(QWindow *window READ window WRITE setWindow NOTIFY windowChanged)
70 Q_PROPERTY(
bool modifierlessAllowed READ modifierlessAllowed WRITE setModifierlessAllowed NOTIFY modifierlessAllowedChanged)
81 Q_PROPERTY(
bool multiKeyShortcutsAllowed READ multiKeyShortcutsAllowed WRITE setMultiKeyShortcutsAllowed NOTIFY multiKeyShortcutsAllowedChanged)
91 Q_PROPERTY(
bool modifierOnlyAllowed READ modifierOnlyAllowed WRITE setModifierOnlyAllowed NOTIFY modifierOnlyAllowedChanged)
108 bool isRecording()
const;
110 QKeySequence currentKeySequence()
const;
111 void setCurrentKeySequence(
const QKeySequence &sequence);
113 QWindow *window()
const;
114 void setWindow(QWindow *window);
116 bool multiKeyShortcutsAllowed()
const;
117 void setMultiKeyShortcutsAllowed(
bool allowed);
119 void setModifierlessAllowed(
bool allowed);
120 bool modifierlessAllowed()
const;
122 void setModifierOnlyAllowed(
bool allowed);
123 bool modifierOnlyAllowed()
const;
140 void recordingChanged();
141 void windowChanged();
142 void currentKeySequenceChanged();
143 void multiKeyShortcutsAllowedChanged();
144 void modifierlessAllowedChanged();
145 void modifierOnlyAllowedChanged();
148 friend class KeySequenceRecorderPrivate;
149 std::unique_ptr<KeySequenceRecorderPrivate>
const d;
Record a QKeySequence by listening to key events in a window.
Definition keysequencerecorder.h:42
void startRecording()
Start recording.
KeySequenceRecorder(QWindow *window, QObject *parent=nullptr)
Constructor.
void cancelRecording()
Stops the recording session.
void gotKeySequence(const QKeySequence &keySequence)
This signal is emitted when a key sequence has been recorded.