diff --git a/doc/python/pages/changelog.rst b/doc/python/pages/changelog.rst index 107fa4f..b8357c7 100644 --- a/doc/python/pages/changelog.rst +++ b/doc/python/pages/changelog.rst @@ -72,6 +72,9 @@ Changelog - Fixed a copypaste error in :ref:`platform.sdl2.Application.MouseMoveEvent.relative_position` and :ref:`platform.glfw.Application.MouseMoveEvent.relative_position` +- Fixed :ref:`platform.sdl2.Application.InputEvent.Modifier` and + :ref:`platform.glfw.Application.InputEvent.Modifier` to behave properly + as flags and not just as an enum `2020.06`_ ========== diff --git a/src/python/magnum/platform/application.h b/src/python/magnum/platform/application.h index 3c5e388..d80d11b 100644 --- a/src/python/magnum/platform/application.h +++ b/src/python/magnum/platform/application.h @@ -82,11 +82,13 @@ template void application(py::class_ void inputEvent(py::class_& c) { - py::enum_{c, "Modifier", "Modifier"} + py::enum_ modifiers{c, "Modifier", "Modifier"}; + modifiers .value("SHIFT", T::Modifier::Shift) .value("CTRL", T::Modifier::Ctrl) .value("ALT", T::Modifier::Alt) .value("SUPER", T::Modifier::Super); + corrade::enumOperators(modifiers); c.def_property("accepted", &T::isAccepted, &T::setAccepted, "Accepted status of the event"); }