InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

UIActionInputModule - all PointerEventDatas have their button set to Left regardless of pressed button

Open covisa opened this issue 7 years ago • 4 comments

All PointerEventDatas received by components implementing IPointerClickHandler, IDragHandler etc. have the button field set to InputButton.Left even when the event originates from Middle Click Action or Right Click Action.

Action setup: actions

Test script:

using UnityEngine;
using UnityEngine.EventSystems;

public class OnPointerClickTest : MonoBehaviour, IPointerClickHandler {
    public void OnPointerClick(PointerEventData eventData) {
        Debug.Log("OnPointerClick: " + eventData.button);
    }
}

Resulting log using all different mouse buttons: log

When using StandaloneInputModule the button field is set as expected.

Reproduced on Windows 10 with Unity 2019.1.0b7 and InputSystem 0.2.1 (also affects earlier InputSystem and Unity versions).

covisa avatar Mar 19 '19 14:03 covisa

If I'm not mistaken, the PointerEventData.button uses the old input mouse button. I don't think it works with the new ISX. @Rene-Damm can you confirm this?

JiaUnity avatar Mar 27 '19 01:03 JiaUnity

Nevermind. This is a bug if it happens. Problem is it doesn't happen on my end: Capture @covisa have you tried 0.2.6-preview or the latest Develop branch?

JiaUnity avatar Apr 13 '19 00:04 JiaUnity

I Repro'd your issue, and found the underlying problem, a fix is incoming.

StayTalm avatar Apr 15 '19 19:04 StayTalm

This is fix in the latest Develop (01d708f). Closing.

JiaUnity avatar May 09 '19 21:05 JiaUnity