Bound UI_Command won't work with FInputChord or Keyboard Focus

Hey there guys.

I’m trying to bind some commands on to a Slate Widget that is on editor window… but it isn’t working… My choices are:

  1. I’m doing this totally wrong
  2. I don’t have focus for some reason

Here’s my code:

//Create the Command mapping
ToolkitCommands->MapAction(
FPaperZDAnimBPEditorCommands::Get().DeleteAnimSequence,
FExecuteAction::CreateSP(this, &SPaperZDMySequences::HandleDeleteSelectedAnimSequence),
FCanExecuteAction());

Where the commands are declared like this:

UI_COMMAND(DeleteAnimSequence, "Delete", "Deletes an AnimSequence, unregistering from the Animation Blueprint", EUserInterfaceActionType::Button, FInputChord(EKeys::Platform_Delete));

But this isn’t working… is there something else i’m missing on how to provide linkage to my commands via pressing DELETE?

Cheers!

Sorry for reviving, but this is the only thread I found when looking for same the thing. If anyone else stumbles onto this, I solved it by adding the command to the global variable GlobalPlayWorldActions like this (as of 5.0.2):

#include "Kismet2/DebuggerCommands.h"

...

FPlayWorldCommands::GlobalPlayWorldActions->MapAction(
		FEditorToolbarButton_TestPluginCommands::Get().PluginAction,
		FExecuteAction::CreateRaw(this, &FEditorToolbarButton_TestPluginModule::PluginButtonClicked),
		FCanExecuteAction::CreateRaw(this, &FEditorToolbarButton_TestPluginModule::CanExecuteAction)
	);

...

// probably also a good idea to unmap your action on ShutdownModule or similar...
FPlayWorldCommands::GlobalPlayWorldActions->UnmapAction(FEditorToolbarButton_TestPluginCommands::Get().PluginAction);
2 Likes