dualsense-ts
Version:
The natural interface for your DualSense and DualSense Access controllers, with Typescript
159 lines • 4.05 kB
TypeScript
export declare const enum LedOptions {
Off = 0,
PlayerLedBrightness = 1,
Uninterruptible = 2,
Both = 3
}
export declare enum PulseOptions {
Off = 0,
FadeBlue = 1,
FadeOut = 2
}
export declare enum MuteLedMode {
Off = 0,
On = 1,
Pulse = 2
}
export declare enum Brightness {
High = 0,
Medium = 1,
Low = 2
}
export declare enum PlayerID {
Player1 = 4,
Player2 = 10,
Player3 = 21,
Player4 = 27,
All = 31
}
/** Audio output routing — controls how L/R channels map to headphone and speaker */
export declare enum AudioOutput {
/** Stereo L+R to headphone, speaker muted */
Headphone = 0,
/** Left channel to headphone (mono), speaker muted */
HeadphoneMono = 16,
/** Left channel to headphone, right channel to speaker */
Split = 32,
/** Headphone muted, right channel to speaker only */
Speaker = 48
}
/** Microphone input source selection */
export declare enum MicSelect {
/** Use internal microphone */
Internal = 1,
/** Use headset microphone */
Headset = 2
}
/** Microphone processing flags (can be combined) */
export declare enum MicFlag {
EchoCancellation = 4,
NoiseCancellation = 8
}
/** Microphone input mode — bits 6-7 of audio flags */
export declare enum MicMode {
/** Default mode */
Default = 0,
/** Chat mode */
Chat = 64,
/** Automatic speech recognition mode */
ASR = 128
}
/** Power save control — per-subsystem mute/disable flags (byte 10) */
export declare enum PowerSave {
DisableTouch = 1,
DisableMotion = 2,
DisableHaptics = 4,
DisableAudio = 8,
MuteMicrophone = 16,
MuteSpeaker = 32,
MuteHeadphone = 64,
MuteHaptics = 128
}
export declare const enum CommandScopeA {
HapticRumble = 1,
PrimaryRumble = 2,
RightTriggerFeedback = 4,
LeftTriggerFeedback = 8,
HeadphoneVolume = 16,
SpeakerVolume = 32,
MicrophoneVolume = 64,
AudioFlags = 128
}
export declare const enum CommandScopeB {
MicrophoneLED = 1,
PowerSave = 2,
TouchpadLeds = 4,
DisableLeds = 8,
PlayerLeds = 16,
MotorPower = 64,
AudioFlags2 = 128
}
export type CommandScope = CommandScopeA | CommandScopeB;
/** Byte value, 0 to 255 */
type Intensity = number;
/** 48 byte packet that is sent to the controller to update LEDs, rumble, etc */
export interface DualsenseCommand extends Uint8Array {
/** Packet type */
[]: 0x2;
/** Scope A — which subsystems are affected */
[]: CommandScopeA | 0xff;
/** Scope B — which subsystems are affected */
[]: CommandScopeB | (0x1 | 0x2 | 0x4 | 0x10 | 0x40);
/** Right rumble intensity */
[]: Intensity;
/** Left rumble intensity */
[]: Intensity;
/** Headphone volume (0x00–0x7F) */
[]: Intensity;
/** Speaker volume (0x00–0xFF, effective range 0x3D–0x64) */
[]: Intensity;
/** Internal microphone volume (0x00–0x40) */
[]: Intensity;
/** Audio flags: bits 0-3 mic source/processing, bits 4-5 output routing, bits 6-7 mic mode */
[]: number;
/** Mute button LED mode */
[]: MuteLedMode;
/** Power save control — per-subsystem mute/disable bitfield */
[]: PowerSave | 0x00;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: number;
[]: 0;
[]: 0;
[]: 0;
[]: 0;
/** Audio flags 2: bits 0-2 speaker preamp gain (0-7), bit 4 beam forming */
[]: number;
[]: 0;
[]: LedOptions;
[]: 0;
[]: 0;
[]: PulseOptions;
[]: Brightness;
[]: PlayerID;
[]: Intensity;
[]: Intensity;
[]: Intensity;
[]: never;
}
export {};
//# sourceMappingURL=command.d.ts.map