RealtimeStyleTransferRuntime/Plugins/GameSettings/Source/Public/Widgets/Misc/GameSettingPressAnyKey.h

46 lines
1.1 KiB
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CommonActivatableWidget.h"
2022-09-13 07:18:28 +00:00
#include "Delegates/Delegate.h"
#include "InputCoreTypes.h"
#include "Templates/Function.h"
#include "Templates/SharedPointer.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "GameSettingPressAnyKey.generated.h"
2022-09-13 07:18:28 +00:00
class UObject;
2022-05-23 18:41:30 +00:00
/**
*
*/
UCLASS(Abstract)
class GAMESETTINGS_API UGameSettingPressAnyKey : public UCommonActivatableWidget
{
GENERATED_BODY()
public:
UGameSettingPressAnyKey(const FObjectInitializer& Initializer);
DECLARE_EVENT_OneParam(UGameSettingPressAnyKey, FOnKeySelected, FKey);
FOnKeySelected OnKeySelected;
DECLARE_EVENT(UGameSettingPressAnyKey, FOnKeySelectionCanceled);
FOnKeySelectionCanceled OnKeySelectionCanceled;
protected:
virtual void NativeOnActivated() override;
virtual void NativeOnDeactivated() override;
void HandleKeySelected(FKey InKey);
void HandleKeySelectionCanceled();
void Dismiss(TFunction<void()> PostDismissCallback);
private:
bool bKeySelected = false;
TSharedPtr<class FSettingsPressAnyKeyInputPreProcessor> InputProcessor;
};