QKeyEvent¶
QKeyEvent
event type send by KeyBoardHandler. More…
Synopsis¶
Functions¶
def
count
()def
isAccepted
()def
isAutoRepeat
()def
key
()def
modifiers
()def
nativeScanCode
()def
setAccepted
(accepted)def
text
()def
type
()
Detailed Description¶
Contains parameters that describe a key event
-
class
PySide2.Qt3DInput.
QKeyEvent
(type, key, modifiers[, text=""[, autorep=false[, count=1]]])¶ - Parameters
type –
Type
modifiers –
KeyboardModifiers
autorep – bool
count –
ushort
text – str
key – int
-
PySide2.Qt3DInput.QKeyEvent.
count
()¶ - Return type
int
Holds the number of keys involved in this event. If
text
is not empty, this is simply the length of the string.
-
PySide2.Qt3DInput.QKeyEvent.
isAccepted
()¶ - Return type
bool
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.
-
PySide2.Qt3DInput.QKeyEvent.
isAutoRepeat
()¶ - Return type
bool
Holds whether this event comes from an auto-repeating key.
-
PySide2.Qt3DInput.QKeyEvent.
key
()¶ - Return type
int
This property holds the code of the key that was pressed or released.
See
Key
for the list of keyboard codes.See also
key()
.
-
PySide2.Qt3DInput.QKeyEvent.
matches
(key_)¶ - Parameters
key –
StandardKey
- Return type
bool
Returns
true
if the key event matches the given standard keykey_
; otherwise returnsfalse
.See also
StandardKey
-
PySide2.Qt3DInput.QKeyEvent.
modifiers
()¶ - Return type
int
This property holds the keyboard modifier flags that existed immediately before the event occurred.
See also
modifiers()
.
-
PySide2.Qt3DInput.QKeyEvent.
nativeScanCode
()¶ - Return type
int
This property contains the native scan code of the key that was pressed. It is passed through from
QKeyEvent
unchanged.
-
PySide2.Qt3DInput.QKeyEvent.
setAccepted
(accepted)¶ - Parameters
accepted – bool
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.
-
PySide2.Qt3DInput.QKeyEvent.
text
()¶ - Return type
str
This 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.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.