I was using PointerMoveEvent to get mouse/pen movement, but the resolution was too low (locked to framerate I believe), so I switched to using InputSystem.onEvent. But the positions I’m getting from these events are confusing. If I have a pointer position from one of those low-level events, how do I get the position relative to a UI element in an EditorWindow?
At runtime, I found RuntimePanelUtils.ScreenToPanel() and that seems to work. But when not in play mode, in a Unity EditorWindow, I’m not understanding what these positions are relative to. Without going into complicated details yet, it seems like they vary based on whether or not the Game window is open in Unity, among other things. I just need something relative to my own EditorWindow and I could work with that.
It seems like the UIToolkit team must have solved this problem because the positions I get from PointerMoveEvent are relative to my own UI space. Is there a EditorPanelUtils API somewhere?