本文整理汇总了C++中FPointerEvent::IsMouseButtonDown方法的典型用法代码示例。如果您正苦于以下问题:C++ FPointerEvent::IsMouseButtonDown方法的具体用法?C++ FPointerEvent::IsMouseButtonDown怎么用?C++ FPointerEvent::IsMouseButtonDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPointerEvent
的用法示例。
在下文中一共展示了FPointerEvent::IsMouseButtonDown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseButtonDown
FReply SGraphEditorImpl::OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if(MouseEvent.IsMouseButtonDown(EKeys::ThumbMouseButton))
{
OnNavigateHistoryBack.ExecuteIfBound();
}
else if(MouseEvent.IsMouseButtonDown(EKeys::ThumbMouseButton2))
{
OnNavigateHistoryForward.ExecuteIfBound();
}
return FReply::Handled().SetKeyboardFocus( SharedThis(this), EKeyboardFocusCause::Mouse );
}
示例2: OnMouseButtonUp
FReply FSceneViewport::OnMouseButtonUp( const FGeometry& InGeometry, const FPointerEvent& InMouseEvent )
{
// Start a new reply state
CurrentReplyState = FReply::Handled();
KeyStateMap.Add( InMouseEvent.GetEffectingButton(), false );
UpdateModifierKeys( InMouseEvent );
UpdateCachedMousePos( InGeometry, InMouseEvent );
UpdateCachedGeometry(InGeometry);
// Switch to the viewport clients world before processing input
FScopedConditionalWorldSwitcher WorldSwitcher( ViewportClient );
bool bCursorVisible = true;
bool bReleaseMouse = true;
if( ViewportClient && GetSizeXY() != FIntPoint::ZeroValue )
{
if (!ViewportClient->InputKey(this, InMouseEvent.GetUserIndex(), InMouseEvent.GetEffectingButton(), IE_Released))
{
CurrentReplyState = FReply::Unhandled();
}
bCursorVisible = ViewportClient->GetCursor(this, GetMouseX(), GetMouseY()) != EMouseCursor::None;
bReleaseMouse =
bCursorVisible ||
ViewportClient->CaptureMouseOnClick() == EMouseCaptureMode::CaptureDuringMouseDown ||
( ViewportClient->CaptureMouseOnClick() == EMouseCaptureMode::CaptureDuringRightMouseDown && InMouseEvent.GetEffectingButton() == EKeys::RightMouseButton );
}
if (!((FApp::IsGame() && !GIsEditor) || bIsPlayInEditorViewport) || bReleaseMouse)
{
// On mouse up outside of the game (editor viewport) or if the cursor is visible in game, we should make sure the mouse is no longer captured
// as long as the left or right mouse buttons are not still down
if( !InMouseEvent.IsMouseButtonDown( EKeys::RightMouseButton ) && !InMouseEvent.IsMouseButtonDown( EKeys::LeftMouseButton ))
{
if( bCursorHiddenDueToCapture )
{
bCursorHiddenDueToCapture = false;
CurrentReplyState.SetMousePos( MousePosBeforeHiddenDueToCapture );
MousePosBeforeHiddenDueToCapture = FIntPoint( -1, -1 );
}
CurrentReplyState.ReleaseMouseCapture();
if (bCursorVisible)
{
CurrentReplyState.ReleaseMouseLock();
}
}
}
return CurrentReplyState;
}
示例3: OnMouseMove
FReply SColorGradientEditor::OnMouseMove( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if( HasMouseCapture() && IsEditingEnabled.Get() == true )
{
DistanceDragged += FMath::Abs( MouseEvent.GetCursorDelta().X );
if( MouseEvent.IsMouseButtonDown( EKeys::LeftMouseButton ) && SelectedStop.IsValid( *CurveOwner ) )
{
const float DragThresholdDist = 5.0f;
if( !bDraggingStop )
{
if( DistanceDragged >= DragThresholdDist )
{
// Start a transaction, we just started dragging a stop
bDraggingStop = true;
GEditor->BeginTransaction( LOCTEXT("MoveGradientStop", "Move Gradient Stop") );
CurveOwner->ModifyOwner();
}
return FReply::Handled();
}
else
{
// Already dragging a stop, move it
FTrackScaleInfo ScaleInfo(ViewMinInput.Get(), ViewMaxInput.Get(), 0.0f, 1.0f, MyGeometry.Size);
float MouseTime = ScaleInfo.LocalXToInput( MyGeometry.AbsoluteToLocal( MouseEvent.GetScreenSpacePosition() ).X );
MoveStop( SelectedStop, MouseTime );
return FReply::Handled();
}
}
}
return FReply::Unhandled();
}
示例4: OnMouseButtonDown
FReply SInlineEditableTextBlock::OnMouseButtonDown( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if( !MouseEvent.IsMouseButtonDown(EKeys::LeftMouseButton) || MouseEvent.IsControlDown() || MouseEvent.IsShiftDown())
{
return FReply::Unhandled();
}
if(IsSelected.IsBound())
{
if(IsSelected.Execute() && !bIsReadOnly.Get() && !ActiveTimerHandle.IsValid())
{
RegisterActiveTimer(0.5f, FWidgetActiveTimerDelegate::CreateSP(this, &SInlineEditableTextBlock::TriggerEditMode));
}
}
else
{
// The widget is not managed by another widget, so handle the mouse input and enter edit mode if ready.
if(HasKeyboardFocus())
{
EnterEditingMode();
}
return FReply::Handled();
}
// Do not handle the mouse input, this will allow for drag and dropping events to trigger.
return FReply::Unhandled();
}
示例5: OnItemDragDetected
FReply SWorldHierarchyItem::OnItemDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
if (MouseEvent.IsMouseButtonDown(EKeys::LeftMouseButton))
{
TSharedPtr<FLevelDragDropOp> Op = WorldModel->CreateDragDropOp();
if (Op.IsValid())
{
// Start a drag-drop
return FReply::Handled().BeginDragDrop(Op.ToSharedRef());
}
}
return FReply::Unhandled();
}
示例6: OnMouseMove
FReply SPaperEditorViewport::OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
const bool bIsRightMouseButtonDown = MouseEvent.IsMouseButtonDown(EKeys::RightMouseButton);
const bool bIsLeftMouseButtonDown = MouseEvent.IsMouseButtonDown(EKeys::LeftMouseButton);
if (HasMouseCapture())
{
// Track how much the mouse moved since the mouse down.
const FVector2D CursorDelta = MouseEvent.GetCursorDelta();
TotalMouseDelta += CursorDelta.Size();
if (bIsRightMouseButtonDown)
{
FReply ReplyState = FReply::Handled();
if (!CursorDelta.IsZero())
{
bShowSoftwareCursor = true;
}
bIsPanning = true;
ViewOffset -= CursorDelta / GetZoomAmount();
return ReplyState;
}
else if (bIsLeftMouseButtonDown)
{
// TSharedPtr<SNode> NodeBeingDragged = NodeUnderMousePtr.Pin();
// Update the amount to pan panel
UpdateViewOffset(MyGeometry, MouseEvent.GetScreenSpacePosition());
const bool bCursorInDeadZone = TotalMouseDelta <= FSlateApplication::Get().GetDragTriggerDistance();
{
// We are marquee selecting
const FVector2D GraphMousePos = PanelCoordToGraphCoord( MyGeometry.AbsoluteToLocal( MouseEvent.GetScreenSpacePosition() ) );
Marquee.Rect.UpdateEndPoint(GraphMousePos);
return FReply::Handled();
}
}
}
return FReply::Unhandled();
}
示例7: GetCefMouseModifiers
int32 FWebBrowserWindow::GetCefMouseModifiers(const FPointerEvent& InMouseEvent)
{
int32 Modifiers = GetCefInputModifiers(InMouseEvent);
if (InMouseEvent.IsMouseButtonDown(EKeys::LeftMouseButton))
{
Modifiers |= EVENTFLAG_LEFT_MOUSE_BUTTON;
}
if (InMouseEvent.IsMouseButtonDown(EKeys::MiddleMouseButton))
{
Modifiers |= EVENTFLAG_MIDDLE_MOUSE_BUTTON;
}
if (InMouseEvent.IsMouseButtonDown(EKeys::RightMouseButton))
{
Modifiers |= EVENTFLAG_RIGHT_MOUSE_BUTTON;
}
return Modifiers;
}
示例8: OnDragDetected
FReply STrackNode::OnDragDetected( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if (AllowDrag && MouseEvent.IsMouseButtonDown( EKeys::LeftMouseButton ) )
{
bBeingDragged = true;
return BeginDrag( MyGeometry, MouseEvent );
}
return FReply::Unhandled();
}
示例9: OnMouseEnter
void STrack::OnMouseEnter( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if ( MouseEvent.IsMouseButtonDown( EKeys::LeftMouseButton ) )
{
UpdateDraggableBarIndex(MyGeometry, MouseEvent.GetScreenSpacePosition());
if ( DraggableBarIndex != INDEX_NONE )
{
bDraggingBar = true;
}
}
}
示例10: OnCursorQuery
FCursorReply STableViewBase::OnCursorQuery( const FGeometry& MyGeometry, const FPointerEvent& CursorEvent ) const
{
if ( IsRightClickScrolling() && CursorEvent.IsMouseButtonDown(EKeys::RightMouseButton) )
{
// We hide the native cursor as we'll be drawing the software EMouseCursor::GrabHandClosed cursor
return FCursorReply::Cursor( EMouseCursor::None );
}
else
{
return FCursorReply::Unhandled();
}
}
示例11: OnCursorQuery
FCursorReply SSequencerTrackArea::OnCursorQuery( const FGeometry& MyGeometry, const FPointerEvent& CursorEvent ) const
{
if (CursorEvent.IsMouseButtonDown(EKeys::RightMouseButton) && HasMouseCapture())
{
return FCursorReply::Cursor(EMouseCursor::GrabHandClosed);
}
auto SequencerPin = SequencerWidget.Pin();
if (SequencerPin.IsValid())
{
return SequencerPin->GetEditTool().OnCursorQuery(MyGeometry, CursorEvent);
}
return FCursorReply::Unhandled();
}
示例12: OnMouseMove
FReply SAnimTrackPanel::OnMouseMove( const FGeometry& InMyGeometry, const FPointerEvent& InMouseEvent )
{
const bool bRightMouseButtonDown = InMouseEvent.IsMouseButtonDown(EKeys::RightMouseButton);
// When mouse moves, if we are moving a key, update its 'input' position
if(bRightMouseButtonDown)
{
if( !bPanning )
{
PanningDistance += FMath::Abs(InMouseEvent.GetCursorDelta().X);
if ( PanningDistance > FSlateApplication::Get().GetDragTriggerDistance() )
{
bPanning = true;
UE_LOG(LogAnimation, Log, TEXT("MouseMove (Capturing Mouse) %d, %0.5f"), bPanning, PanningDistance);
return FReply::Handled().CaptureMouse(SharedThis(this));
}
}
else
{
FTrackScaleInfo ScaleInfo(ViewInputMin.Get(), ViewInputMax.Get(), 0.f, 0.f, InMyGeometry.Size);
FVector2D ScreenDelta = InMouseEvent.GetCursorDelta();
FVector2D InputDelta;
InputDelta.X = ScreenDelta.X/ScaleInfo.PixelsPerInput;
InputDelta.Y = -ScreenDelta.Y/ScaleInfo.PixelsPerOutput;
float NewViewInputMin = ViewInputMin.Get() - InputDelta.X;
float NewViewInputMax = ViewInputMax.Get() - InputDelta.X;
// we'd like to keep the range if outside when panning
if ( NewViewInputMin < InputMin.Get() )
{
NewViewInputMin = InputMin.Get();
NewViewInputMax = ScaleInfo.ViewInputRange;
}
else if ( NewViewInputMax > InputMax.Get() )
{
NewViewInputMax = InputMax.Get();
NewViewInputMin = NewViewInputMax - ScaleInfo.ViewInputRange;
}
OnSetInputViewRange.Execute(NewViewInputMin, NewViewInputMax);
UE_LOG(LogAnimation, Log, TEXT("MouseMove (Panning) %0.2f, %0.2f"), ViewInputMin.Get(), ViewInputMax.Get());
return FReply::Handled();
}
}
return FReply::Unhandled();
}
示例13: OnDragDetected
FReply SFlipbookKeyframeWidget::OnDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
if (MouseEvent.IsMouseButtonDown(EKeys::LeftMouseButton))
{
UPaperFlipbook* Flipbook = FlipbookBeingEdited.Get();
if ((Flipbook != nullptr) && Flipbook->IsValidKeyFrameIndex(FrameIndex))
{
TSharedRef<FFlipbookKeyFrameDragDropOp> Operation = FFlipbookKeyFrameDragDropOp::New(
GetFrameWidth().Get(), Flipbook, FrameIndex);
return FReply::Handled().BeginDragDrop(Operation);
}
}
return FReply::Unhandled();
}
示例14: OnMouseMove
FReply STableViewBase::OnMouseMove( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
if( MouseEvent.IsMouseButtonDown( EKeys::RightMouseButton ) )
{
const float ScrollByAmount = MouseEvent.GetCursorDelta().Y / MyGeometry.Scale;
// If scrolling with the right mouse button, we need to remember how much we scrolled.
// If we did not scroll at all, we will bring up the context menu when the mouse is released.
AmountScrolledWhileRightMouseDown += FMath::Abs( ScrollByAmount );
// Has the mouse moved far enough with the right mouse button held down to start capturing
// the mouse and dragging the view?
if( IsRightClickScrolling() )
{
// Make sure the active timer is registered to update the inertial scroll
if (!bIsScrollingActiveTimerRegistered)
{
bIsScrollingActiveTimerRegistered = true;
RegisterActiveTimer(0.f, FWidgetActiveTimerDelegate::CreateSP(this, &STableViewBase::UpdateInertialScroll));
}
TickScrollDelta -= ScrollByAmount;
const float AmountScrolled = this->ScrollBy( MyGeometry, -ScrollByAmount, AllowOverscroll );
FReply Reply = FReply::Handled();
// The mouse moved enough that we're now dragging the view. Capture the mouse
// so the user does not have to stay within the bounds of the list while dragging.
if(this->HasMouseCapture() == false)
{
Reply.CaptureMouse( AsShared() ).UseHighPrecisionMouseMovement( AsShared() );
SoftwareCursorPosition = MyGeometry.AbsoluteToLocal( MouseEvent.GetScreenSpacePosition() );
bShowSoftwareCursor = true;
}
// Check if the mouse has moved.
if( AmountScrolled != 0 )
{
SoftwareCursorPosition.Y += ScrollByAmount;
}
return Reply;
}
}
return FReply::Unhandled();
}
示例15: OnMouseMove
FReply SSequencerTrackArea::OnMouseMove( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent )
{
auto SequencerPin = SequencerWidget.Pin();
if (SequencerPin.IsValid())
{
FReply Reply = SequencerPin->GetEditTool().OnMouseMove(*this, MyGeometry, MouseEvent);
if (Reply.IsEventHandled())
{
return Reply;
}
}
if (MouseEvent.IsMouseButtonDown(EKeys::RightMouseButton) && HasMouseCapture())
{
TreeView.Pin()->ScrollByDelta( -MouseEvent.GetCursorDelta().Y );
}
return TimeSliderController->OnMouseMove( SharedThis(this), MyGeometry, MouseEvent );
}