KeyEvent QML Type

QML frontend for QKeyEvent C++ 类。 更多...

import 语句: import Qt3D.Input 2.15
Since: Qt 5.5
实例化: QKeyEvent

特性

方法

详细描述

The KeyEvent QML type cannot be directly created. Objects of this type are used as signal parameters in KeyboardHandler .

特性文档编制

accepted : bool

设置 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.

[read-only] count : int

Holds the number of keys involved in this event. If text is not empty, this is simply the length of the string.

[read-only] isAutoRepeat : bool

Holds whether this event comes from an auto-repeating key.

[read-only] key : int

This property holds the code of the key that was pressed or released.

Qt.Key for the list of keyboard codes.

另请参阅 KeyEvent.key .

[read-only] modifiers : int

This property holds the keyboard modifier flags that existed immediately before the event occurred.

另请参阅 KeyEvent.modifiers .

[read-only] nativeScanCode : quint32

This property contains the native scan code of the key that was pressed. It is passed through from QKeyEvent unchanged.

另请参阅 QKeyEvent::nativeScanCode() .

[read-only] text : string

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.

方法文档编制

bool 匹配 ( StandardKey key )

返回 true 若键事件匹配给定标准 key ;否则返回 false .

另请参阅 QKeySequence::StandardKey .