XrVirtualMouse QML Type
将 3D 控制器输入映射到 2D 项目中的鼠标输入。更多
Import Statement: | import QtQuick3D.Xr |
Since: | Qt 6.8 |
Inherits: | |
Status: | Technical Preview |
属性
- enabled : bool
- leftMouseButton : bool
- middleMouseButton : bool
- rightMouseButton : bool
- scrollPixelDelta : real
- scrollTimerInterval : int
- scrollWheelX : real
- scrollWheelY : real
- source : Node
- view : XrView
详细说明
XrVirtualMouse 提供了一种在 3D 场景中与2D 用户界面交互的方式。
它通常是这样使用的:
// XrView { id: xrView // XrController { id: rightController XrInputAction { id: rightTrigger hand: XrInputAction.RightHand actionId: [XrInputAction.TriggerPressed, XrInputAction.TriggerValue] } XrVirtualMouse { view: xrView source: rightController leftMouseButton: rightTrigger.pressed }
属性文档
enabled : bool |
表示虚拟鼠标是否启用。为真时,虚拟鼠标会向场景中的 2D 对象发送鼠标事件。
leftMouseButton : bool |
设置鼠标左键的状态。
设置为 true 时,鼠标左键被按下。
middleMouseButton : bool |
设置鼠标中键的状态。
设置为 true 时,鼠标中键被按下。
rightMouseButton : bool |
设置鼠标右键的状态。
设置为 true 时,鼠标右键被按下。
scrollPixelDelta : real |
scrollTimerInterval : int |
以毫秒为单位定义发送到系统的滚动事件之间的时间。
scrollWheelX : real |
scrollWheelY : real |
source : Node |
控制虚拟鼠标的 3D 节点。
source
属性通常设置为XrController 。在source
节点的forward vector 与 2D 项目相交的位置会产生鼠标事件。
view : XrView |
与虚拟鼠标关联的 XR 视图。虚拟鼠标运行时的视图。
© 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.