shortcutApi.h 742 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <windowSystemm/input.h>
  3. #include <unordered_map>
  4. namespace pika
  5. {
  6. struct ShortcutManager
  7. {
  8. struct Shortcut
  9. {
  10. std::string shortcut = "";
  11. bool *toggle = 0;
  12. bool editable = true;
  13. };
  14. void update(const pika::Input &input);
  15. std::unordered_map<std::string, Shortcut> registeredShortcuts;
  16. bool registerShortcut(const char *name, const char *s, bool *toggle, bool editable = 1);
  17. const char *getShortcut(const char *name);
  18. };
  19. bool shortcut(const pika::Input &input, const char *shortcut);
  20. bool MenuItem(const pika::Input &input, const char *label, const char *shortcut, bool *p_selected, bool enabled = true);
  21. std::string normalizeShortcutName(const char *shortcut);
  22. void initShortcutApi();
  23. }