ShortcutKey.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /// <summary>
  7. /// A key combination that is used for triggering keyboard shortcuts. Contains a button code and an optional modifier.
  8. /// </summary>
  9. [StructLayout(LayoutKind.Sequential)]
  10. public struct ShortcutKey // Note: Must match C++ class ShortcutKey
  11. {
  12. /// <summary>
  13. /// Optional modifier that is required to be pressed along with the shortcut button
  14. /// </summary>
  15. public ButtonModifier modifier;
  16. /// <summary>
  17. /// Shortcut button that triggers the shortcut.
  18. /// </summary>
  19. public ButtonCode key;
  20. /// <summary>
  21. /// Creates a new shortcut key.
  22. /// </summary>
  23. /// <param name="modifier">Optional modifier that is required to be pressed along with the shortcut button.</param>
  24. /// <param name="key">Shortcut button that triggers the shortcut.</param>
  25. public ShortcutKey(ButtonModifier modifier, ButtonCode key)
  26. {
  27. this.modifier = modifier;
  28. this.key = key;
  29. }
  30. /// <summary>
  31. /// Blank shortcut key that is triggered by no key combination.
  32. /// </summary>
  33. public static ShortcutKey None = new ShortcutKey(ButtonModifier.None, ButtonCode.Unassigned);
  34. }
  35. }