handleKeyDown method

  1. @HostListener('keydown')
  2. @visibleForTemplate
void handleKeyDown(
  1. 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();
}