ShortcutHandler.h 675 B

1234567891011121314151617181920212223242526
  1. /*
  2. * ShortcutHandler.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. enum class EShortcut;
  12. class ShortcutHandler
  13. {
  14. std::multimap<std::string, EShortcut> mappedShortcuts;
  15. public:
  16. ShortcutHandler();
  17. /// returns list of shortcuts assigned to provided SDL keycode
  18. std::vector<EShortcut> translateKeycode(const std::string & key) const;
  19. /// attempts to find shortcut by its unique identifier. Returns EShortcut::NONE on failure
  20. EShortcut findShortcut(const std::string & identifier ) const;
  21. };