@hcodes/webhid-ds4
    Preparing search index...

    Interface DualShock4State

    Controller State

    Stores information about the current controller state, and its components.

    interface DualShock4State {
        axes: DualShock4AnalogState;
        batteryCapacity: number | null;
        batteryStatus: BatteryStatus;
        buttons: DualShock4ButtonState;
        cableConnected: boolean;
        externalDeviceConnected: boolean;
        headphonesConnected: boolean;
        interface: DualShock4Interface;
        microphoneConnected: boolean;
        reportCounter: number | null;
        sensorTimestamp: number | null;
        timestamp: number;
        touchpad: DualShock4Touchpad;
    }
    Index

    Analog positions

    batteryCapacity: number | null

    Battery capacity (0-100), or null when it cannot be determined.

    batteryStatus: BatteryStatus

    Current battery state.

    Buttons pressed

    cableConnected: boolean

    Whether the controller reports a cable connected, independently of the HID transport.

    externalDeviceConnected: boolean

    Raw controller flag indicating a device connected to the EXT accessory port.

    headphonesConnected: boolean

    Whether the controller reports headphones connected to its 3.5 mm jack.

    Interface used for communication (USB/Bluetooth)

    microphoneConnected: boolean

    Whether the controller reports a microphone connected to its 3.5 mm jack.

    reportCounter: number | null

    Raw 6-bit input report counter (0-63), or null before the first input report. Wraps at 64.

    sensorTimestamp: number | null

    Raw 16-bit sensor timestamp (0-65535), or null before a full input report. Wraps at 65536.

    timestamp: number

    Browser event timestamp of the last report, in milliseconds.

    Touchpad