KeyEvent QML Type
Import Statement: | import Qt3D.Input 2.9 |
In C++: | QKeyEvent |
Status: | Deprecated |
属性
- accepted : bool
- count : int
- isAutoRepeat : bool
- key : int
- modifiers : int
- nativeScanCode : quint32
- text : string
方法
- bool matches(StandardKey key)
详细说明
KeyEvent QML 类型不能直接创建。该类型的对象在KeyboardHandler 中用作信号参数。
属性文档
accepted : bool |
将accepted设置为true
会阻止 key 事件传播到项目的父节点。
一般情况下,如果项目对按键事件做出反应,则应接受该事件,以免祖先项目也对同一事件做出反应。
isAutoRepeat : bool |
该事件是否来自自动重复键。
key : int |
modifiers : int |
该属性包含事件发生前的键盘修改器标志。
另请参阅 KeyEvent.modifiers 。
nativeScanCode : quint32 |
该属性包含按下的键的本地扫描代码。它将原封不动地从QKeyEvent 传递过来。
另请参阅 QKeyEvent::nativeScanCode() 。
text : string |
该属性包含按键生成的 Unicode 文本。在按下或释放 Shift、Control、Alt 和 Meta 等修饰符键的情况下,返回的文本可以是空字符串。在这种情况下,key 将包含一个有效值。
方法文档
bool matches(StandardKey key) |
如果按键事件符合给定的标准key ,则返回true
;否则返回false
。
另请参见 QKeySequence::StandardKey 。
© 2025 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.