diff --git a/Source/Blu/Private/BluEye.cpp b/Source/Blu/Private/BluEye.cpp index 2e80b80..66eb0c2 100644 --- a/Source/Blu/Private/BluEye.cpp +++ b/Source/Blu/Private/BluEye.cpp @@ -246,6 +246,14 @@ void UBluEye::TriggerRightMouseUp(const FVector2D& pos, const float scale) browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_RIGHT, true, 1); } +void UBluEye::TriggerMouseWheel(const float MouseWheelDelta, const FVector2D& pos, const float scale) +{ + mouse_event.x = pos.X / scale; + mouse_event.y = pos.Y / scale; + + browser->GetHost()->SendMouseWheelEvent(mouse_event, MouseWheelDelta * 10, MouseWheelDelta * 10); +} + void UBluEye::KeyDown(FKeyEvent InKey) { diff --git a/Source/Blu/Public/BluEye.h b/Source/Blu/Public/BluEye.h index f146adc..748b04f 100644 --- a/Source/Blu/Public/BluEye.h +++ b/Source/Blu/Public/BluEye.h @@ -160,6 +160,10 @@ class BLU_API UBluEye : public UObject UFUNCTION(BlueprintCallable, Category = "Blu") void TriggerMouseMove(const FVector2D& pos, const float scale = 1); + /* Move the mouse in the browser */ + UFUNCTION(BlueprintCallable, Category = "Blu") + void TriggerMouseWheel(const float MouseWheelDelta, const FVector2D& pos, const float scale = 1); + /* Javascript event emitter */ UPROPERTY(BlueprintAssignable) FScriptEvent ScriptEventEmitter;