More work on managing input events
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user