API-solution? How to stop Esc from closing Sample Record Dialog?

Hi, I’m wondering, how could I absolutely, and once and for all, stop Esc from closing the Sample Record Dialog? Do I need to have some sort of GUI window open that relays Esc only to the pattern editor or…?