More work on managing input events

This commit is contained in:
2026-04-16 00:13:48 -04:00
parent 8a3d200247
commit 26399a6a15
20 changed files with 66 additions and 33 deletions

View File

@@ -74,9 +74,9 @@ FVector2D AlxPlayerControllerBase::GetLookAtPixel(const UObject *Context)
void AlxPlayerControllerBase::BeginPlay()
{
Super::BeginPlay();
CharacterModeInput = NewObject<UInputComponent>(this);
CharacterModeInput->bBlockInput = false;
PushInputComponent(CharacterModeInput);
HotkeyInputComponent = NewObject<UInputComponent>(this);
HotkeyInputComponent->bBlockInput = false;
PushInputComponent(HotkeyInputComponent);
}
void AlxPlayerControllerBase::UpdateEventDispatch()
@@ -121,7 +121,7 @@ void AlxPlayerControllerBase::UpdateEventDispatch()
{
SetInputMode(FInputModeGameOnly());
CharacterModeInput->KeyBindings.Empty();
HotkeyInputComponent->KeyBindings.Empty();
TSet<FKey> BoundKeys;
for (const FlxEventRequest &Req : Requests)
{
@@ -130,7 +130,7 @@ void AlxPlayerControllerBase::UpdateEventDispatch()
if (!BoundKeys.Contains(Key))
{
BoundKeys.Add(Key);
CharacterModeInput->BindKey(Key, IE_Pressed, this, &AlxPlayerControllerBase::ForwardKeyEvent);
HotkeyInputComponent->BindKey(Key, IE_Pressed, this, &AlxPlayerControllerBase::ForwardKeyEvent);
}
}
}