Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.0.0-preview.4

Issue ID

1234377

Regression

No

Mouse position is not in correct coordinate space when accessed from EditorWindow.OnGUI

Package: Input System

-

Tested on macOS using `"com.unity.inputsystem":"1.0.0-preview.4"`. Using 2 external monitors with the Macbook lid closed.

When reading the mouse position, x values are starting at the far right of the window and decreasing to negative width on the far left, and y is starting at what seems to be the top of the status bar and going up. The docs say that input should be mapped to EditorWindow coordinates, but that doesn’t seem to be the case.

Tested with the following script:

[CODE]
using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputTesting : EditorWindow
{
[MenuItem("Window/Debug SceneView Input")]
static void Init()
{
GetWindow<InputTesting>();
}
void OnEnable()
{
SceneView.duringSceneGui += OnSceneView;
}
void OnDisable()
{
SceneView.duringSceneGui -= OnSceneView;
}
void OnSceneView(SceneView view)
{
var mouse = $"{Mouse.current.position.x.ReadValue()}, {Mouse.current.position.y.ReadValue()}";
Handles.BeginGUI();
GUILayout.Label(mouse);
Handles.EndGUI();
if (Event.current.type == EventType.MouseMove)
SceneView.RepaintAll();
}
}
[/CODE]

  1. Resolution Note:

    "For context, we're going to nuke edit mode support in the input system. Pen support with pressure and tilt is coming to IMGUI and UI Elements and will solve the problem here much better than the input system can."

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.