Still working on event handling for hotkey widgets

This commit is contained in:
2025-05-23 15:33:18 -04:00
parent 28f1c4c819
commit 40da211985
32 changed files with 254 additions and 158 deletions

View File

@@ -8,6 +8,8 @@
#include "Kismet/GameplayStatics.h"
#include "Blueprint/UserWidget.h"
#include "Components/GridPanel.h"
#include "InputMappingContext.h"
#define LOCTEXT_NAMESPACE "Luprex Utility"
@@ -209,3 +211,21 @@ void UlxUtilityLibrary::GetPositionOfGridPanelMiddleCell(UGridPanel *GridPanel,
LowerRightXY.Y = (Row[0] + Row[1]) / TotalY;
}
}
void UlxUtilityLibrary::MapAllKeyboardKeysToOneInputAction(UInputMappingContext *IMC, UInputAction *Action)
{
TArray<FKey> AllKeys;
EKeys::GetAllKeys(AllKeys);
// Map every keyboard key to the provided LuaAction
for (const FKey& Key : AllKeys)
{
if ((Key.IsValid()) &&
(Key.IsBindableInBlueprints()) &&
(Key.GetMenuCategory() == EKeys::NAME_KeyboardCategory) &&
(!Key.IsModifierKey()))
{
IMC->MapKey(Action, Key);
}
}
}