InputDevicePartKeyEvent.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. }
  21. }
  22. }
  23. protected override void DispatchEventTarget() {
  24. }
  25. protected override void OnUpdateEvent() {
  26. }
  27. }
  28. }