diff --git a/include/NazaraEditor/Core/Application/Shortcut.hpp b/include/NazaraEditor/Core/Application/Shortcut.hpp index 77b1ffe..0fc37db 100644 --- a/include/NazaraEditor/Core/Application/Shortcut.hpp +++ b/include/NazaraEditor/Core/Application/Shortcut.hpp @@ -1,9 +1,41 @@ #pragma once +#include +#include + +#include + namespace Nz { - struct Shortcut + struct NAZARAEDITOR_CORE_API Shortcut { + bool bCtrl : 1; + bool bShift : 1; + std::vector keys; + std::string ToString() const + { + std::ostringstream oss; + if (bCtrl) oss << "Ctrl+"; + if (bShift) oss << "Shift+"; + for (size_t i = 0; i < keys.size(); ++i) + { + oss << Nz::Keyboard::GetKeyName(keys[i]); + if (i < keys.size() - 1) + oss << "+"; + } + return oss.str(); + } + + static Shortcut Create(Nz::Keyboard::VKey key, bool bCtrl, bool bShift) + { + Shortcut shortcut + { + .bCtrl = bCtrl, + .bShift = bShift, + .keys = { key } + }; + return shortcut; + } }; } \ No newline at end of file