0.2.0

Keyboard events fire when the user presses arrow keys during an active tour. These events are emitted only when keyboard control is enabled.

Events

EventString valueWhen
ON_KEYBOARD_NEXTkeyboard:nextArrowRight is pressed
ON_KEYBOARD_PREVkeyboard:prevArrowLeft is pressed

Usage

import { BordaEvent } from '@retoo/borda';

instance.api.events.on(BordaEvent.ON_KEYBOARD_NEXT, () => {
  console.log('ArrowRight pressed');
});

instance.api.events.on(BordaEvent.ON_KEYBOARD_PREV, () => {
  console.log('ArrowLeft pressed');
});

Notes

  • Keypresses originating from form controls (input, textarea, select, contenteditable) are ignored.
  • The Escape key emits ON_TOUR_CLOSE, not a keyboard event.
  • Keyboard listeners are automatically removed on unmount.