I am trying to bind the ESC
key to a custom elisp function,
(global-set-key (kbd "<escape>") 'my-local-mode)
which works under X but does not when emacs is running in a termial. ESC acts as META. However I have tried evil mode and it is able to capture ESC (single ESC not M-ESC ESC). However digging thorugh the code I can not figure out where/how they did it. describe-key
doesn't work. How can I bind single ESC press to call my function?