MAIDR JavaScript API
    Preparing search index...

    Class HidBrailleAbstract

    Reads the layout of a braille display that speaks the USB HID braille standard, and writes and reads its reports.

    The standard leaves the report layout to the device: which report each row of cells goes in, where in it, and how the keys are packed. A screen reader asks the operating system, which parses the report descriptor; a page asks WebHID, which hands over the same parse as collections of items. Everything here is read from those, so a display that numbers its reports differently, or puts its rows in one report or in several, is driven the same way.

    Index

    Methods

    • Reads where a braille display keeps its cells and its keys.

      The rows come out top to bottom: in the order the descriptor declares its Braille Row collections, which is the order a screen reader fills them. WebHID lists a report's items under the top-level collection in the order they are declared, which gives each cell field its place in its report, but it does not keep the reports themselves in order; the row collections are what say which field is which row. Cells declared outside any row collection follow, by report ID.

      Parameters

      Returns HidBrailleLayout | null

      The layout, or null when the device has no braille cells

    • Builds the output reports that put a set of cells on the display.

      Parameters

      • layout: HidBrailleLayout

        Where the display keeps its cells

      • cells: Uint8Array

        Every cell on the display, row after row, bit 0 being dot 1

      Returns Map<number, Uint8Array<ArrayBufferLike>>

      The data of each report, without its ID, by report ID

    • Finds a run of single-bit output fields declared under one usage.

      The standard has cells and nothing finer, so a display that offers more -- a Monarch can be written pin by pin -- declares it under a usage of its own.

      Parameters

      • collections: readonly HidCollectionInfo[]

        The device's top-level collections

      • usage: number

        The extended usage the run is declared under

      Returns HidBitField | null

      Where the run is, or null when the device has none

    • Builds the output report that sets a run of single-bit fields.

      Parameters

      • field: HidBitField

        Where the run is

      • bits: Uint8Array

        The values, eight to a byte, the first in the lowest bit

      Returns Uint8Array

      The report's data, without its ID