I’m wrinting an Editor plugin, which registers a hotkey function and map it to a function via the usual
UI_COMMAND(MyPlugin_edit, "edit", "manually edit",
EUserInterfaceActionType::Button, FInputChord(EKeys::E));
...
CommandBindings->MapAction(FMyPluginCommands::Get().MyPlugin_edit,
FExecuteAction::CreateRaw(this, &FMyPluginModule::MyPlugin_edit),
EUIActionRepeatMode::RepeatDisabled);
Inside FMyPluginModule::MyPlugin_edit, I need a certain SMultiLineEditableText (the mltw below) to get keyboard focus, so that the user can input data after the plugin routine returned, without them using the mouse to click the widget first.
I do this via a
mltw->ClearSelection();
mltw->GoTo(ETextLocation::BeginningOfDocument);
FSlateApplication::Get().SetKeyboardFocus(mltw, EFocusCause::Mouse);
This works fine, EXCEPT the “E” hotkey used to invoke the plugin routine doesn’t get consumed.
Means, when the plugin returns, the correct widget indeed has the keyboard focus as intended, with blinking cursor and all, and the user can e.g. directly start to type or edit the text inside.
BUT it adds the “E” to the data, just as if the user had typed the E key at first.
Any suggestions how I can get rid of the hotkey in the input buffer, or any suggestions for an alternative approach ?