rhodonite
    Preparing search index...

    Function getEvent

    • Gets the appropriate event name based on device capabilities and event type. Automatically detects whether to use touch, pointer, or mouse events based on device support. Priority order: Pointer events (modern browsers) > MS Pointer events (legacy IE) > Touch events > Mouse events

      Parameters

      • type: "end" | "start" | "move" | "click"

        The type of event to get ('start', 'move', 'end', or 'click')

      Returns string

      The appropriate event name string for the current device

      Error if called in a non-browser environment

      const startEvent = getEvent('start'); // Returns 'pointerdown', 'touchstart', or 'mousedown'
      element.addEventListener(startEvent, handler);