Skip to content

Instantly share code, notes, and snippets.

@nikitalita
Created October 29, 2020 03:31
Show Gist options
  • Save nikitalita/4e777441f0a9a5a76c94cec5bd70633b to your computer and use it in GitHub Desktop.
Save nikitalita/4e777441f0a9a5a76c94cec5bd70633b to your computer and use it in GitHub Desktop.
steamdevicereport.ts
/**
* Steam device's connection state.
*/
export const enum SteamDeviceState {
Disconnected = 0x00,
Pairing = 0x01,
Connected = 0x02,
}
/**
* Steam device report interface.
*/
export interface SteamDeviceReport extends MotionDataWithQuaternion {
packetCounter: number;
battery: number;
timestamp: number;
macAddress: string;
state: SteamDeviceState;
button: {
RT: boolean,
LT: boolean,
RS: boolean,
LS: boolean,
Y: boolean,
B: boolean,
X: boolean,
A: boolean,
previous: boolean,
steam: boolean,
next: boolean,
dPad: {
UP: boolean,
RIGHT: boolean,
LEFT: boolean,
DOWN: boolean,
},
grip: {
LEFT: boolean,
RIGHT: boolean,
},
stick: boolean,
rightPad: boolean,
};
touch: {
leftPad: boolean,
rightPad: boolean,
};
trigger: {
LEFT: number,
RIGHT: number,
};
position: {
stick: { x: number, y: number },
leftPad: { x: number, y: number },
rightPad: { x: number, y: number },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment