You can do it the following way.
-
Set input mode UI only from eg. where you create the widget
-
In the widget on construct, add a set focus node. Make sure your widget is set to focusable in it
root object
- Override the OnKeyDown function in the widget and return Handled if it was the correct key, then do you logic for removing it (Could be remove from parent eg.)