handleKeyDown method
- @HostListener('keydown')
- @visibleForTemplate
void
handleKeyDown(
- KeyboardEvent event
)
Implementation
@HostListener('keydown')
@visibleForTemplate
void handleKeyDown(KeyboardEvent event) {
if (event.target != _root) return;
var focusEvent = FocusMoveEvent.fromKeyboardEvent(this, event);
if (!focusEvent.valid) return;
if (event.ctrlKey) {
_focusMoveCtrl.add(focusEvent);
} else {
_selectionMoveCtrl.add(focusEvent);
}
// Required to prevent window from scrolling.
event.preventDefault();
}