#if USING_MRTK2

using UnityEngine.Events;
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit;

namespace SimplifyXR
{

    public class MRTK2GlobalTapMapping : BaseInputHandler, IMixedRealityInputHandler, IGlobalTapMapping
    {
        private void OnEnable()
        {
            CoreServices.InputSystem?.RegisterHandler<IMixedRealityInputHandler>(this);
            CoreServices.InputSystem?.RegisterHandler<IMixedRealityInputHandler>(this);

            //responses are global, and the logic for handling focus is at panel level through register/unregister
            IsFocusRequired = false;
        }

        private void OnDisable()
        {
            CoreServices.InputSystem?.UnregisterHandler<IMixedRealityInputHandler>(this);
            CoreServices.InputSystem?.UnregisterHandler<IMixedRealityInputHandler>(this);
        }

        public UnityEvent AirTap;

        UnityEvent IGlobalTapMapping.AirTap => AirTap;

        public void OnInputUp(InputEventData eventData)
        {
        }

        public void OnInputDown(InputEventData eventData)
        {
            AirTap?.Invoke();
        }

        protected override void RegisterHandlers()
        {
            throw new System.NotImplementedException();
        }

        protected override void UnregisterHandlers()
        {
            throw new System.NotImplementedException();
        }
    }
}

#endif
