Skip to content
This repository was archived by the owner on May 3, 2019. It is now read-only.

Commit e35078a

Browse files
committed
Added mouse wheel scroll method, closes #18
1 parent ec54769 commit e35078a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Source/Blu/Private/BluEye.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ void UBluEye::TriggerRightMouseUp(const FVector2D& pos, const float scale)
246246
browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_RIGHT, true, 1);
247247
}
248248

249+
void UBluEye::TriggerMouseWheel(const float MouseWheelDelta, const FVector2D& pos, const float scale)
250+
{
251+
mouse_event.x = pos.X / scale;
252+
mouse_event.y = pos.Y / scale;
253+
254+
browser->GetHost()->SendMouseWheelEvent(mouse_event, MouseWheelDelta * 10, MouseWheelDelta * 10);
255+
}
256+
249257
void UBluEye::KeyDown(FKeyEvent InKey)
250258
{
251259

Source/Blu/Public/BluEye.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ class BLU_API UBluEye : public UObject
160160
UFUNCTION(BlueprintCallable, Category = "Blu")
161161
void TriggerMouseMove(const FVector2D& pos, const float scale = 1);
162162

163+
/* Move the mouse in the browser */
164+
UFUNCTION(BlueprintCallable, Category = "Blu")
165+
void TriggerMouseWheel(const float MouseWheelDelta, const FVector2D& pos, const float scale = 1);
166+
163167
/* Javascript event emitter */
164168
UPROPERTY(BlueprintAssignable)
165169
FScriptEvent ScriptEventEmitter;

0 commit comments

Comments
 (0)