How to close/stop widget by onKey-/onStop-event?

Hi,

I would like to stop / close a widget by the ESC-Key (2-Button Venu SQ). I would use an onKey-Event and determine, which button is pressed.

Which command to use to return from there to the onStop-function and to close the widget (at the moment I just close the device simulator manually.

Thanks