2
0

ShortcutKey.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /** @addtogroup GUI_Engine
  7. * @{
  8. */
  9. /// <summary>
  10. /// A key combination that is used for triggering keyboard shortcuts. Contains a button code and an optional modifier.
  11. /// </summary>
  12. [StructLayout(LayoutKind.Sequential)]
  13. public struct ShortcutKey // Note: Must match C++ class ShortcutKey
  14. {
  15. /// <summary>
  16. /// Optional modifier that is required to be pressed along with the shortcut button
  17. /// </summary>
  18. public ButtonModifier modifier;
  19. /// <summary>
  20. /// Shortcut button that triggers the shortcut.
  21. /// </summary>
  22. public ButtonCode key;
  23. /// <summary>
  24. /// Creates a new shortcut key.
  25. /// </summary>
  26. /// <param name="modifier">Optional modifier that is required to be pressed along with the shortcut button.</param>
  27. /// <param name="key">Shortcut button that triggers the shortcut.</param>
  28. public ShortcutKey(ButtonModifier modifier, ButtonCode key)
  29. {
  30. this.modifier = modifier;
  31. this.key = key;
  32. }
  33. /// <summary>
  34. /// Blank shortcut key that is triggered by no key combination.
  35. /// </summary>
  36. public static ShortcutKey None = new ShortcutKey(ButtonModifier.None, ButtonCode.Unassigned);
  37. }
  38. /** @} */
  39. }