Newer
Older
DungeonShooting / DungeonShooting_Godot / editor / src / EditorShortcutKey.cs
@小李xl 小李xl on 26 Sep 2022 848 bytes 感应输入事件, 并触发提示窗口
  1. using System;
  2. using Godot;
  3.  
  4. namespace DScript.GodotEditor
  5. {
  6. /// <summary>
  7. /// 用在静态函数上, 当按下指定键位后调用函数, 仅在 DScript.GodotEditor 命名空间下生效
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Method)]
  10. public class EditorShortcutKey : Attribute
  11. {
  12. /// <summary>
  13. /// 绑定的快捷键
  14. /// </summary>
  15. public KeyList Key;
  16.  
  17. /// <summary>
  18. /// 是否检测 Ctrl
  19. /// </summary>
  20. public bool Ctrl = false;
  21.  
  22. /// <summary>
  23. /// 是否检测 Shift
  24. /// </summary>
  25. public bool Shift = false;
  26.  
  27. /// <summary>
  28. /// 是否检测 Alt
  29. /// </summary>
  30. public bool Alt = false;
  31.  
  32. public EditorShortcutKey(KeyList key)
  33. {
  34. Key = key;
  35. }
  36. }
  37. }