Maps 3D controller input to mouse input in 2D items. 更多...
| import 语句: |
import QtQuick3D.Xr
|
| Since: | Qt 6.8 |
| 继承: | |
| 状态: | 技术预览 |
The XrVirtualMouse provides a way to interact with 2D user interfaces in the 3D scene.
It is typically used like this:
// 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 |
Indicates whether the virtual mouse is enabled. When true, the virtual mouse sends mouse events to 2D objects in the scene.
|
leftMouseButton : bool |
Sets the state of the left mouse button.
When set to true, the left mouse button is pressed.
|
middleMouseButton : bool |
Sets the state of the middle mouse button.
When set to true, the middle mouse button is pressed.
|
rightMouseButton : bool |
Sets the state of the right mouse button.
When set to true, the right mouse button is pressed.
|
scrollPixelDelta
:
real
|
Defines the base distance scrolled with each scrolling event.
This is the distance scrolled when the scrolling speed is 1.
另请参阅 scrollWheelX and scrollWheelY .
|
scrollTimerInterval
:
int
|
Defines time in milliseconds between scrolling events sent to the system.
|
scrollWheelX : real |
Sets the horizontal scrolling speed.
Positive values scroll right and negative values scroll left. Scroll speed increases relative to distance from zero.
另请参阅 scrollPixelDelta .
|
scrollWheelY : real |
Sets the vertical scrolling speed.
Positive values scroll up and negative values scroll down. Scroll speed increases relative to distance from zero.
另请参阅 scrollPixelDelta .
|
source : Node |
The 3D node controlling the virtual mouse.
The
source
property is normally set to an
XrController
. Mouse events are generated for the position where the
forward vector
的
source
node intersects with a 2D item.
|
view : XrView |
The XR view associated with the virtual mouse. Holds the view in which the virtual mouse operates.