shortcutApi.h 760 B

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