diff --git a/src/musikbox/app/util/Hotkeys.cpp b/src/musikbox/app/util/Hotkeys.cpp index f83f7a5ba..498595a01 100755 --- a/src/musikbox/app/util/Hotkeys.cpp +++ b/src/musikbox/app/util/Hotkeys.cpp @@ -44,6 +44,14 @@ using namespace musik::core; using Id = Hotkeys::Id; +/* sigh: http://stackoverflow.com/a/24847480 */ +struct EnumHasher { + template + std::size_t operator()(T t) const { + return static_cast(t); + } +}; + /* map from internal ID to user-friendly JSON key name */ static std::unordered_map NAME_TO_ID = { { "navigate_library", Id::NavigateLibrary }, @@ -69,7 +77,7 @@ static std::unordered_map NAME_TO_ID = { }; /* default hotkeys */ -static std::unordered_map ID_TO_DEFAULT = { +static std::unordered_map ID_TO_DEFAULT = { { Id::NavigateLibrary, "M-a" }, { Id::NavigateLibraryBrowse, "M-b" }, { Id::NavigateLibraryFilter, "M-f" }, @@ -94,7 +102,7 @@ static std::unordered_map ID_TO_DEFAULT = { /* custom keys */ static std::unordered_set customKeys; -static std::unordered_map customIdToKey; +static std::unordered_map customIdToKey; /* preferences file */ static std::shared_ptr prefs; @@ -148,7 +156,7 @@ bool Hotkeys::Is(Id id, const std::string& kn) { return true; } } - + return false; }