Quartz UI ↗
Browse docs
On this page
Private preview · 0.57.0-devView Markdown

QuartzUIInputAdapter: declaration reference

0.57.0-dev · beta source documentation. Native, Blueprint, Editor and rendering examples are source-reviewed, not executed in Unreal during this scan. See validation and limits.

Pinned source (source: Source/QuartzUIRuntime/Public/QuartzUIInputAdapter.h) · integration recipe · practical guide

UQuartzUIInputAdapter

Public type. Open input-provider boundary for projects and optional integration plugins. Implementations detect devices and bindings in C++; JavaScript receives only the normalized state and actions published through this object.

Prerequisites / integration: Exact local player and configured app; Slate/UMG dependencies for native presentation work. Use the QuartzUIInputAdapter recipe in the host module QuartzUIRuntime.

Minimal example / lifecycle: Subclass; RegisterInputAdapter; PublishGlyphProfile; unregister. Activation/context-change/deactivation own device subscriptions.

Avoid: Forgetting travel/reassignment cleanup or exceeding eight adapters. Match the exact declaration below; dependent DTOs/enums are values used by this owner, not independent systems.

Exact source line (source: Source/QuartzUIRuntime/Public/QuartzUIInputAdapter.h#L19)

Complete header

Source snapshot, not an additional example. Unreal annotations distinguish exposed Blueprint nodes from native-only/private methods.

#pragma once

#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "QuartzUIInput.h"

#include "QuartzUIInputAdapter.generated.h"

class APlayerController;
class ULocalPlayer;
class UQuartzUILayerHost;

/**
 * Open input-provider boundary for projects and optional integration plugins.
 * Implementations detect devices and bindings in C++; JavaScript receives only
 * the normalized state and actions published through this object.
 */
UCLASS(BlueprintType, Blueprintable, EditInlineNew, DefaultToInstanced)
class QUARTZUIRUNTIME_API UQuartzUIInputAdapter : public UObject
{
	GENERATED_BODY()

public:
	virtual bool NeedsLoadForServer() const override { return false; }

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
	bool IsActive() const { return bActive; }

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
	UQuartzUILayerHost* GetHost() const { return Host.Get(); }

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
	ULocalPlayer* GetOwningLocalPlayer() const;

	UFUNCTION(BlueprintPure, Category = "QuartzUI|Input")
	APlayerController* GetOwningPlayerController() const;

	/** Authoritative providers suppress only the core modality observer, not navigation. */
	UFUNCTION(BlueprintNativeEvent, BlueprintPure, Category = "QuartzUI|Input")
	bool SuppliesInputModality() const;
	virtual bool SuppliesInputModality_Implementation() const;

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishInputModality(EQuartzUIInputModality Modality);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishInputPresentation(
		EQuartzUIInputModality Modality,
		FName ProfileId,
		const TArray<FQuartzUIResolvedInputGlyph>& Glyphs);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishGamepadConnection(bool bConnected);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishResolvedGlyphs(FName ProfileId, const TArray<FQuartzUIResolvedInputGlyph>& Glyphs);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishGlyphProfile(UQuartzUIInputGlyphProfile* Profile);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishNavigationAction(EQuartzUINavigationAction Action);

	UFUNCTION(BlueprintCallable, Category = "QuartzUI|Input")
	bool PublishInputAction(const FQuartzUIInputActionEvent& ActionEvent);

protected:
	/** Called after the host has an exact local-player stack. Return false to reject activation. */
	UFUNCTION(BlueprintNativeEvent, Category = "QuartzUI|Input")
	bool OnActivated(ULocalPlayer* LocalPlayer, APlayerController* PlayerController);
	virtual bool OnActivated_Implementation(ULocalPlayer* LocalPlayer, APlayerController* PlayerController);

	UFUNCTION(BlueprintNativeEvent, Category = "QuartzUI|Input")
	void OnDeactivated();
	virtual void OnDeactivated_Implementation();

	/** Travel, controller replacement, reassignment, and platform-user changes converge here. */
	UFUNCTION(BlueprintNativeEvent, Category = "QuartzUI|Input")
	void OnInputContextChanged(ULocalPlayer* LocalPlayer, APlayerController* PlayerController);
	virtual void OnInputContextChanged_Implementation(ULocalPlayer* LocalPlayer, APlayerController* PlayerController);

private:
	bool Activate(UQuartzUILayerHost* InHost);
	void Deactivate();
	void NotifyInputContextChanged();

	TWeakObjectPtr<UQuartzUILayerHost> Host;
	bool bActive = false;

	friend class UQuartzUILayerHost;
};