@ -34,6 +34,13 @@
namespace Magnum { namespace Platform {
namespace Magnum { namespace Platform {
static_assert ( NaClApplication : : MouseEvent : : Button : : WheelUp ! = NaClApplication : : MouseEvent : : Button : : Left & &
NaClApplication : : MouseEvent : : Button : : WheelUp ! = NaClApplication : : MouseEvent : : Button : : Middle & &
NaClApplication : : MouseEvent : : Button : : WheelUp ! = NaClApplication : : MouseEvent : : Button : : Right & &
NaClApplication : : MouseEvent : : Button : : WheelDown ! = NaClApplication : : MouseEvent : : Button : : Left & &
NaClApplication : : MouseEvent : : Button : : WheelDown ! = NaClApplication : : MouseEvent : : Button : : Middle & &
NaClApplication : : MouseEvent : : Button : : WheelDown ! = NaClApplication : : MouseEvent : : Button : : Right , " " ) ;
struct NaClApplication : : ConsoleDebugOutput {
struct NaClApplication : : ConsoleDebugOutput {
explicit ConsoleDebugOutput ( pp : : Instance * instance ) ;
explicit ConsoleDebugOutput ( pp : : Instance * instance ) ;
@ -195,6 +202,15 @@ bool NaClApplication::HandleInputEvent(const pp::InputEvent& event) {
break ;
break ;
}
}
case PP_INPUTEVENT_TYPE_WHEEL : {
pp : : WheelInputEvent wheelEvent ( event ) ;
if ( Math : : TypeTraits < Float > : : equals ( wheelEvent . GetDelta ( ) . y ( ) , 0.0f ) ) return false ;
MouseEvent e ( wheelEvent . GetDelta ( ) . y ( ) > 0 ? MouseEvent : : Button : : WheelUp : MouseEvent : : Button : : WheelDown , { } , static_cast < InputEvent : : Modifier > ( wheelEvent . GetModifiers ( ) ) ) ;
mousePressEvent ( e ) ;
if ( ! e . isAccepted ( ) ) return false ;
break ;
}
case PP_INPUTEVENT_TYPE_MOUSEMOVE : {
case PP_INPUTEVENT_TYPE_MOUSEMOVE : {
pp : : MouseInputEvent mouseEvent ( event ) ;
pp : : MouseInputEvent mouseEvent ( event ) ;
MouseMoveEvent e ( { mouseEvent . GetPosition ( ) . x ( ) , mouseEvent . GetPosition ( ) . y ( ) } , { mouseEvent . GetMovement ( ) . x ( ) , mouseEvent . GetMovement ( ) . y ( ) } , static_cast < InputEvent : : Modifier > ( mouseEvent . GetModifiers ( ) ) ) ;
MouseMoveEvent e ( { mouseEvent . GetPosition ( ) . x ( ) , mouseEvent . GetPosition ( ) . y ( ) } , { mouseEvent . GetMovement ( ) . x ( ) , mouseEvent . GetMovement ( ) . y ( ) } , static_cast < InputEvent : : Modifier > ( mouseEvent . GetModifiers ( ) ) ) ;