# Bound UI\_Command won't work with FInputChord or Keyboard Focus

**URL:** <https://forums.unrealengine.com/t/bound-ui-command-wont-work-with-finputchord-or-keyboard-focus/419421>\
**Category:** UI\
**Tags:** command, unreal-engine, slate, UI, Plugins, question, CPP\
**Created:** [March 9, 2018, 8:27pm UTC](https://forums.unrealengine.com/t/bound-ui-command-wont-work-with-finputchord-or-keyboard-focus/419421 "2018-03-09T20:27:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HeavyBullets](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HeavyBullets](https://forums.unrealengine.com/u/HeavyBullets)\
**Post date:** [March 9, 2018, 8:27pm UTC](https://forums.unrealengine.com/t/bound-ui-command-wont-work-with-finputchord-or-keyboard-focus/419421/1 "2018-03-09T20:27:17Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Ivis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivis](https://forums.unrealengine.com/u/Ivis)\
**Post date:** [July 20, 2022, 5:27pm UTC](https://forums.unrealengine.com/t/bound-ui-command-wont-work-with-finputchord-or-keyboard-focus/419421/2 "2022-07-20T17:27:08Z")

</div>

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):

```auto
#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);

```
