QKeyEvent event type send by KeyBoardHandler. More...
Header: | #include <QKeyEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dinput) target_link_libraries(mytarget PRIVATE Qt6::3dinput) |
qmake: | QT += 3dinput |
Since: | Qt 5.5 |
Instantiated By: | KeyEvent |
Inherits: | QObject |
|
|
int | count() const |
bool | isAccepted() const |
bool | isAutoRepeat() const |
int | key() const |
bool | matches(QKeySequence::StandardKey key_) const |
int | modifiers() const |
quint32 | nativeScanCode() const |
void | setAccepted(bool accepted) |
QString | text() const |
QEvent::Type | type() const |
Setting accepted to true
prevents the key event from being propagated to the item's parent.
Generally, if the item acts on the key event then it should be accepted so that ancestor items do not also respond to the same event.
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
[read-only]
count : const intHolds the number of keys involved in this event. If text is not empty, this is simply the length of the string.
Access functions:
int | count() const |
[read-only]
isAutoRepeat : const boolHolds whether this event comes from an auto-repeating key.
Access functions:
bool | isAutoRepeat() const |
[read-only]
key : const intThis property holds the code of the key that was pressed or released.
See Qt.Key for the list of keyboard codes.
See also QKeyEvent::key().
Access functions:
int | key() const |
[read-only]
modifiers : const intThis property holds the keyboard modifier flags that existed immediately before the event occurred.
See also QKeyEvent::modifiers().
Access functions:
int | modifiers() const |
[read-only]
nativeScanCode : const quint32This property contains the native scan code of the key that was pressed. It is passed through from QKeyEvent unchanged.
Access functions:
quint32 | nativeScanCode() const |
[read-only]
text : const QStringThis property holds the Unicode text that the key generated. The text returned can be an empty string in cases where modifier keys, such as Shift, Control, Alt, and Meta, are being pressed or released. In such cases key will contain a valid value.
Access functions:
QString | text() const |
[invokable]
bool QKeyEvent::matches(QKeySequence::StandardKey key_) constReturns true
if the key event matches the given standard key key_; otherwise returns false
.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also QKeySequence::StandardKey.
Returns the type of the event.