I have another solution for you. You can approach it differently by getting the input in the widget separately and implementing OnKeyDown or OnPreviewKeyDown in the widget.