Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Angular detecting escape key press

const ESCAPE_KEYCODE = 27;

@HostListener('document:keydown', ['$event']) onKeydownHandler(event: KeyboardEvent) {
    if (event.keyCode === ESCAPE_KEYCODE) {
        // ...
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Angular #detecting #escape #key #press
ADD COMMENT
Topic
Name
4+7 =