InputDevicePartKeyEvent.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UnityEngine;
  7. using UnityEngine.EventSystems;
  8. namespace SC.XR.Unity.Module_InputSystem {
  9. public class InputDevicePartKeyEvent : InputDevicePartEventBase {
  10. public InputDevicePartKeyEvent(InputDevicePartDispatchEventBase inputDevicePartDispatchEventBase) :base(inputDevicePartDispatchEventBase) {
  11. }
  12. protected override void DispatchEventDelegate() {
  13. foreach(var item in inputDataBase.inputKeys.inputKeyPressDic) {
  14. if(item.Value == InputKeyState.DOWN) {
  15. DispatcherBase.KeyDownDelegateInvoke(item.Key, inputDevicePartDispatchEventBase.inputDevicePartBase);
  16. } else if(item.Value == InputKeyState.UP) {
  17. DispatcherBase.KeyUpDelegateInvoke(item.Key, inputDevicePartDispatchEventBase.inputDevicePartBase);
  18. } else if(item.Value == InputKeyState.LONG) {
  19. DispatcherBase.KeyLongDelegateInvoke(item.Key, inputDevicePartDispatchEventBase.inputDevicePartBase);
  20. } else if (item.Value == InputKeyState.TouchEnter) {
  21. DispatcherBase.KeyTouchEnterDelegateInvoke(item.Key, inputDevicePartDispatchEventBase.inputDevicePartBase);
  22. } else if (item.Value == InputKeyState.TouchExit) {
  23. DispatcherBase.KeyTouchExitDelegateInvoke(item.Key, inputDevicePartDispatchEventBase.inputDevicePartBase);
  24. }
  25. }
  26. }
  27. protected override void DispatchEventTarget() {
  28. }
  29. protected override void OnUpdateEvent() {
  30. }
  31. }
  32. }