better handling of the escape-key

Idea created by Markus Schneider on Oct 1, 2017

    the escape-key is a bit a misery. In some dialogs (custom functions, messages,) it closes the editors without any warning (work is lost), in other dialogs (ie open remote) the esc key doesn't work (should work as the cancel-button in that dialog)