Suggestion: May be we need to add a keydown listener to modal dialogue body and we can stop an event with the help of stopPropogation method by passing the current event object. When user presses ESC button, in the event handler we should get the type of key pressed and if it is ESC event then we can stop its propogation using stopPropogation method by passing current event object.
May be this can help you in achieving your requirement.
I tried to solve in your way. But I am not able to solve it. So tried in below way. Its worked for me. Anyway can you provide the steps . May be I missed some of the steps in your suggestion. Thank you for suggestion.
Finally I tried below way. First I save as the pzModalTemplate and change the control of cancel button From pzModalButton to pxModalButtonCancel. And called the save as section (Template Name). It is worked as Expected.