XrVirtualMouse QML Type

Maps 3D controller input to mouse input in 2D items. More...

Import Statement: import QtQuick3D.Xr
Since: Qt 6.8
Inherits:

Item

Status: Technical Preview

Properties

Detailed Description

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
}

Property Documentation

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 : float [default: 15]

Defines the base distance scrolled with each scrolling event.

This is the distance scrolled when the scrolling speed is 1.

See also scrollWheelX and scrollWheelY.


scrollTimerInterval : int [default: 30]

Defines time in milliseconds between scrolling events sent to the system.


scrollWheelX : float

Sets the horizontal scrolling speed.

Positive values scroll right and negative values scroll left. Scroll speed increases relative to distance from zero.

See also scrollPixelDelta.


scrollWheelY : float

Sets the vertical scrolling speed.

Positive values scroll up and negative values scroll down. Scroll speed increases relative to distance from zero.

See also 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 of the 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.


© 2024 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.