I thank @Gawish for the response as it helped me to find the solution. I couldn't use that solution because there is no type:"keyPress" in clientListener in ADF 11g. However I did like this and it works very well:
window.onkeyup = function (e) {
if (e.keyCode == 27) {
var button = AdfPage.PAGE.findComponentByAbsoluteId('cb1');
AdfActionEvent.queue(button, true);
e.cancel();
}
}
Pay attention, e.cancel() at the end is mandatory!