ShortcutHandler.h 619 B

123456789101112131415161718192021222324
  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. using SDL_Keycode = int32_t;
  13. class ShortcutHandler
  14. {
  15. public:
  16. /// returns list of shortcuts assigned to provided SDL keycode
  17. std::vector<EShortcut> translateKeycode(SDL_Keycode key) const;
  18. /// attempts to find shortcut by its unique identifier. Returns EShortcut::NONE on failure
  19. EShortcut findShortcut(const std::string & identifier ) const;
  20. };