Into your page (or if is for more pages into your master page) you should use JavaScript and AJAX call of your method like in the next example:
<script type="text/javascript">
function onKeydown(evt) {
if (evt != undefined && evt.keyCode == 27)
{
$.ajax({
type: "POST",
url: "/Account/OnEscHandler"
});
}
};
window.document.onkeydown = onKeydown;
</script>