using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.EventSystems;
namespace SC.XR.Unity.Module_InputSystem {
public abstract class DispatcherBase : SCModule {
public InputDevicePartDispatchEventBase inputDevicePartDispatchEventBase;
public DispatcherBase(InputDevicePartDispatchEventBase inputDevicePartDispatchEventBase) {
this.inputDevicePartDispatchEventBase = inputDevicePartDispatchEventBase;
}
///
/// When Any part Device of Any key Down will invoke this delegate
///
/// which key
/// which part,part.PartType
static event AnyKeyEventDelegate AnyKeyDownDelegate;
///
/// When Any part Device of Any key Up will invoke this delegate
///
/// which key
/// which part,part.PartType
static event AnyKeyEventDelegate AnyKeyUpDelegate;
///
/// When Any part Device of Any key Long will invoke this delegate
///
/// which key
/// which part,part.PartType
static event AnyKeyEventDelegate AnyKeyLongDelegate;
///
/// When Any part Device of Any key TouchEnter will invoke this delegate
///
/// which key
/// which part,part.PartType
static event AnyKeyEventDelegate AnyKeyTouchEnterDelegate;
///
/// When Any part Device of Any key TouchExit will invoke this delegate
///
/// which key
/// which part,part.PartType
static event AnyKeyEventDelegate AnyKeyTouchExitDelegate;
public static void KeyDownDelegateInvoke(InputKeyCode keyCode,InputDevicePartBase inputDevicePart) {
AnyKeyDownDelegate?.Invoke(keyCode, inputDevicePart);
}
public static void KeyUpDelegateInvoke(InputKeyCode keyCode, InputDevicePartBase inputDevicePart) {
AnyKeyUpDelegate?.Invoke(keyCode, inputDevicePart);
}
public static void KeyLongDelegateInvoke(InputKeyCode keyCode, InputDevicePartBase inputDevicePart) {
AnyKeyLongDelegate?.Invoke(keyCode, inputDevicePart);
}
public static void KeyTouchEnterDelegateInvoke(InputKeyCode keyCode, InputDevicePartBase inputDevicePart) {
AnyKeyTouchEnterDelegate?.Invoke(keyCode, inputDevicePart);
}
public static void KeyTouchExitDelegateInvoke(InputKeyCode keyCode, InputDevicePartBase inputDevicePart) {
AnyKeyTouchExitDelegate?.Invoke(keyCode, inputDevicePart);
}
public static void KeyDownDelegateRegister(AnyKeyEventDelegate keyDownEventDelegate) { AnyKeyDownDelegate += keyDownEventDelegate; }
public static void KeyDownDelegateUnRegister(AnyKeyEventDelegate keyDownEventDelegate) { AnyKeyDownDelegate -= keyDownEventDelegate; }
public static void KeyUpDelegateRegister(AnyKeyEventDelegate keyUpEventDelegate) { AnyKeyUpDelegate += keyUpEventDelegate; }
public static void KeyUpDelegateUnRegister(AnyKeyEventDelegate keyUpEventDelegate) { AnyKeyUpDelegate -= keyUpEventDelegate; }
public static void KeyLongDelegateRegister(AnyKeyEventDelegate keyLongEventDelegate) { AnyKeyLongDelegate += keyLongEventDelegate; }
public static void KeyLongDelegateUnRegister(AnyKeyEventDelegate keyLongEventDelegate) { AnyKeyLongDelegate -= keyLongEventDelegate; }
public static void KeyTouchEnterDelegateRegister(AnyKeyEventDelegate keyTouchEnterEventDelegate) { AnyKeyTouchEnterDelegate += keyTouchEnterEventDelegate; }
public static void KeyTouchEnterDelegateUnRegister(AnyKeyEventDelegate keyTouchEnterEventDelegate) { AnyKeyTouchEnterDelegate -= keyTouchEnterEventDelegate; }
public static void KeyTouchExitDelegateRegister(AnyKeyEventDelegate keyTouchExitEventDelegate) { AnyKeyTouchExitDelegate += keyTouchExitEventDelegate; }
public static void KeyTouchExitDelegateUnRegister(AnyKeyEventDelegate keyTouchExitEventDelegate) { AnyKeyTouchExitDelegate -= keyTouchExitEventDelegate; }
}
}