Still working on event handling for hotkey widgets
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user