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

Commit

Permalink
Added mouse wheel scroll method, closes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
ashea-code committed Feb 23, 2015
1 parent ec54769 commit e35078a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Blu/Private/BluEye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down
4 changes: 4 additions & 0 deletions Source/Blu/Public/BluEye.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e35078a

Please sign in to comment.