This client side code seems to work in Notes 8.5.2 at least:
dojo.addOnLoad( function(){
dojo.connect( document, 'keydown', function(e){
// 27 -> Key code for ESC -> stop event
if(e.keyCode === 27){ dojo.stopEvent(e); }
});
});