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

39 lines
982 B
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "CommonActivatableWidget.h"
#include "GameSettingPressAnyKey.generated.h"
/**
*
*/
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;
};