diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 3b65d9450..65e1d7780 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -246,6 +246,7 @@ GlfwApplication::Configuration::Configuration(): GlfwApplication::Configuration::~Configuration() = default; +#if defined(DOXYGEN_GENERATING_OUTPUT) || GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302 std::string GlfwApplication::KeyEvent::keyName(const Key key) { /* It can return null, so beware */ return Utility::String::fromArray(glfwGetKeyName(int(key), 0)); @@ -254,6 +255,7 @@ std::string GlfwApplication::KeyEvent::keyName(const Key key) { std::string GlfwApplication::KeyEvent::keyName() const { return keyName(_key); } +#endif template class BasicScreen; template class BasicScreenedApplication; diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 1dfdfad48..8d0655cfa 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -744,14 +744,35 @@ class GlfwApplication::KeyEvent: public GlfwApplication::InputEvent { Menu = GLFW_KEY_MENU /**< Menu */ }; - /** @copydoc Sdl2Application::KeyEvent::keyName(Key) */ + #if defined(DOXYGEN_GENERATING_OUTPUT) || GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302 + /** + * @brief Name for given key + * + * Human-readable localized UTF-8 name for given @p key, intended for + * displaying to the user in e.g. key binding configuration. If there + * is no name for given key, empty string is returned. + * @see @ref keyName(Key) + * @note Supported since GLFW 3.2. + */ static std::string keyName(Key key); + #endif /** @copydoc Sdl2Application::KeyEvent::key() */ constexpr Key key() const { return _key; } - /** @copydoc Sdl2Application::KeyEvent::keyName() const */ + #if defined(DOXYGEN_GENERATING_OUTPUT) || GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302 + /** + * @brief Key name + * + * Human-readable localized UTF-8 name for the key returned by + * @ref key(), intended for displaying to the user in e.g. + * key binding configuration. If there is no name for that key, empty + * string is returned. + * @see @ref keyName(Key) + * @note Supported since GLFW 3.2. + */ std::string keyName() const; + #endif /** @brief Modifiers */ constexpr Modifiers modifiers() const { return _modifiers; }