38 #include "Coherent/UI/InputEvents.h"
40 #include "CoherentUIBackwardsCompatibility.h"
42 #if defined (COHERENT_UI_UE4_4_5_SUPPORT)
45 #include "SlateBasics.h"
48 #include "SCompoundWidget.h"
49 #include "SCoherentInputForward.generated.h"
61 DECLARE_MULTICAST_DELEGATE_OneParam(FCoherentInputWidgetMouseButtonDown,
const FKey&);
62 DECLARE_MULTICAST_DELEGATE_OneParam(FCoherentInputWidgetMouseButtonUp,
const FKey&);
63 DECLARE_MULTICAST_DELEGATE_OneParam(FCoherentInputWidgetKeyDown,
const FKey&);
64 DECLARE_MULTICAST_DELEGATE_OneParam(FCoherentInputWidgetKeyUp,
const FKey&);
67 enum EInputWidgetRaycastQuality
69 RQ_Fast UMETA(DisplayName=
"Fast"),
70 RQ_Balanced UMETA(DisplayName=
"Balanced"),
71 RQ_Accurate UMETA(DisplayName=
"Accurate"),
76 enum EInputWidgetLineTraceMode
78 InputLineTrace_Single UMETA(DisplayName =
"Single object trace"),
79 InputLineTrace_Multi UMETA(DisplayName =
"Multiple objects trace"),
83 class SCoherentInputForward :
public SCompoundWidget
86 SLATE_BEGIN_ARGS(SCoherentInputForward) {}
87 SLATE_ARGUMENT(TWeakObjectPtr<AActor>, Owner)
90 COHERENTUIPLUGIN_API virtual ~SCoherentInputForward();
91 COHERENTUIPLUGIN_API
void Construct(const FArguments& InArgs);
93 COHERENTUIPLUGIN_API virtual FReply OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
94 COHERENTUIPLUGIN_API virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
95 COHERENTUIPLUGIN_API virtual FReply OnMouseButtonDoubleClick( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
96 COHERENTUIPLUGIN_API virtual FReply OnMouseButtonUp( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
97 COHERENTUIPLUGIN_API virtual FReply OnMouseWheel(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
98 COHERENTUIPLUGIN_API virtual FReply OnDragDetected( const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
99 #if defined (COHERENT_UI_UE4_4_5_SUPPORT)
100 COHERENTUIPLUGIN_API
virtual FReply OnKeyDown(
const FGeometry& MyGeometry,
const FKeyboardEvent& KeyEvent)
override;
101 COHERENTUIPLUGIN_API
virtual FReply OnKeyUp(
const FGeometry& MyGeometry,
const FKeyboardEvent& KeyEvent)
override;
103 COHERENTUIPLUGIN_API
virtual FReply OnKeyDown(
const FGeometry& MyGeometry,
const FKeyEvent& KeyEvent)
override;
104 COHERENTUIPLUGIN_API
virtual FReply OnKeyUp(
const FGeometry& MyGeometry,
const FKeyEvent& KeyEvent)
override;
106 COHERENTUIPLUGIN_API
virtual FReply OnKeyChar(
const FGeometry& MyGeometry,
const FCharacterEvent& InCharacterEvent)
override;
107 COHERENTUIPLUGIN_API
virtual bool SupportsKeyboardFocus()
const override;
109 #if defined (COHERENT_UI_UE4_4_5_SUPPORT)
110 COHERENTUIPLUGIN_API
virtual FReply OnKeyboardFocusReceived(
const FGeometry& MyGeometry,
const FKeyboardFocusEvent& InKeyboardFocusEvent)
override;
111 COHERENTUIPLUGIN_API
virtual void OnKeyboardFocusLost(
const FKeyboardFocusEvent& InKeyboardFocusEvent)
override;
112 COHERENTUIPLUGIN_API
virtual void OnKeyboardFocusChanging(
const FWeakWidgetPath& PreviousFocusPath,
const FWidgetPath& NewWidgetPath)
override;
114 COHERENTUIPLUGIN_API
virtual FReply OnFocusReceived(
const FGeometry& MyGeometry,
const FFocusEvent& InKeyboardFocusEvent)
override;
115 COHERENTUIPLUGIN_API
virtual void OnFocusChanging(
const FWeakWidgetPath& PreviousFocusPath,
const FWidgetPath& NewWidgetPath)
override;
116 COHERENTUIPLUGIN_API
virtual void OnFocusLost(
const FFocusEvent& InKeyboardFocusEvent)
override;
119 COHERENTUIPLUGIN_API
void SetRaycastCollisionGroup(ECollisionChannel CollisionChannel);
120 COHERENTUIPLUGIN_API
void SetRaycastTextureAddressMode(TextureAddress TextureAddressMode);
121 COHERENTUIPLUGIN_API
void SetRaycastQuality(EInputWidgetRaycastQuality RaycastQuality);
122 COHERENTUIPLUGIN_API
void SetRaycastUVChannel(uint32 UVChannel);
124 DEPRECATED(4.6,
"SetForceAcceptInputEvents is deprecated. Use SetAlwaysAcceptMouseInputEvents instead.")
125 COHERENTUIPLUGIN_API
void SetForceAcceptInputEvents(
bool Accept);
126 COHERENTUIPLUGIN_API
void SetAlwaysAcceptMouseInputEvents(
bool bAccept);
127 COHERENTUIPLUGIN_API
void SetPropagateKeyboardEvents(
bool bPropagate);
128 COHERENTUIPLUGIN_API
void SetLineTraceMode(EInputWidgetLineTraceMode Mode);
132 FCoherentInputWidgetMouseButtonDown OnCoherentInputWidgetMouseButtonDown;
133 FCoherentInputWidgetMouseButtonUp OnCoherentInputWidgetMouseButtonUp;
134 FCoherentInputWidgetKeyDown OnCoherentInputWidgetKeyDown;
135 FCoherentInputWidgetKeyUp OnCoherentInputWidgetKeyUp;
138 Coherent::UI::KeyEventData MakeKeyEvent(const FInputEvent& Event, Coherent::UI::KeyEventData::EventType Type);
139 void ProcessKeyEvent(const FInputEvent& Event, Coherent::UI::KeyEventData::EventType Type);
141 void GetMouseDataFromFPointerEvent(Coherent::UI::MouseEventData& Data, const FGeometry& MyGeometry, const FPointerEvent& MouseEvent, Coherent::UI::MouseEventData::EventType EventType);
143 FReply OnMouseEvent(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent, Coherent::UI::MouseEventData::EventType EventType);
145 FReply DiscardViewFocus(Coherent::UI::MouseEventData::EventType EventType);
148 ECollisionChannel RaycastCollisionChannel;
149 TextureAddress RaycastTextureAddressMode;
150 EInputWidgetRaycastQuality RaycastQuality;
152 bool bHasKeyboardFocus;
153 bool bAlwaysAcceptMouseInputEvents;
154 bool bPropagateKeyboardEvents;
155 TEnumAsByte<EInputWidgetLineTraceMode> LineTraceMode;
157 TWeakObjectPtr<AActor> OwnerActor;
Definition: CoherentBaseComponent.h:76