MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Hololens: Executing IWithMouseEvents.MouseEvent(...) releases MRTK's PointerDown.
@champnic is already working on this.
Since Jul 10, 2023.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
Executing IWithMouseEvents.MouseEvent(...) releases MRTK's PointerDown.
Version
SDK: com.microsoft.mixedreality.webview.unity-0.17.1-pre.3.tgz
Runtime: Unity2021.3.24 (Run on Editor)
Framework: Unity2021.3.24, MRTK2.8.3
OS: Windows10 22H2
Regression
Was this working before but has regressed? > No.
If yes, what version did this last work on?
Repro Steps
- Clone this repository.
https://github.com/MicrosoftEdge/WebView2Samples/ - Open this sample in UnityEditor.
https://github.com/MicrosoftEdge/WebView2Samples/tree/main/GettingStartedGuides/HoloLens2_GettingStarted/HoloLens2GetStartedApp - Attach this script to "Canvas"
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.WebView;
using UnityEngine;
public class Sample : MonoBehaviour, IMixedRealityPointerHandler
{
private IWebView webView;
private void Start()
{
GetComponentInChildren<WebView>().GetWebViewWhenReady((IWebView webView) =>
{
this.webView = webView;
});
}
public void OnPointerDown(MixedRealityPointerEventData eventData)
{
Debug.Log("OnPointerDown");
WebViewMouseEventData mouseEvent = new WebViewMouseEventData
{
X = 0,
Y = 0,
Type = WebViewMouseEventData.EventType.MouseDown,
Button = WebViewMouseEventData.MouseButton.ButtonLeft,
TertiaryAxisDeviceType = WebViewMouseEventData.TertiaryAxisDevice.PointingDevice
};
(webView as IWithMouseEvents).MouseEvent(mouseEvent);
}
public void OnPointerDragged(MixedRealityPointerEventData eventData)
{
Debug.Log("Dragged");
}
public void OnPointerUp(MixedRealityPointerEventData eventData)
{
Debug.Log("OnPointerUp");
}
public void OnPointerClicked(MixedRealityPointerEventData eventData)
{
}
}
- Run it, put the pointer on the Canvas and press the left mouse button.
- The following is logged to the console:
OnPointerDown
Dragged
OnPointerUp
I expect only PointerDown (and Dragged) to be logged.
Commenting out this line gives the expected behavior.
(webView as IWithMouseEvents).MouseEvent(mouseEvent);
Screenshots
Additional context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.