onKeyDown method

void onKeyDown(
  1. KeyboardEvent event
)

Keydown callback used to handle arrow keys.

Implementation

void onKeyDown(KeyboardEvent event) {
  switch (event.keyCode) {
    case KeyCode.UP:
      handleUpKey(event);
      break;
    case KeyCode.DOWN:
      handleDownKey(event);
      break;
    case KeyCode.LEFT:
      if (isRtl == true) {
        handleRightKey(event);
      } else {
        handleLeftKey(event);
      }
      break;
    case KeyCode.RIGHT:
      if (isRtl == true) {
        handleLeftKey(event);
      } else {
        handleRightKey(event);
      }
      break;
    case KeyCode.PAGE_UP:
      handlePageUp(event);
      break;
    case KeyCode.PAGE_DOWN:
      handlePageDown(event);
      break;
    case KeyCode.HOME:
      handleHomeKey(event);
      break;
    case KeyCode.END:
      handleEndKey(event);
      break;
    case KeyCode.BACKSPACE:
      handleBackspaceKey(event);
      break;
    case KeyCode.DELETE:
      handleDeleteKey(event);
      break;
  }
}