diff --git a/src/deck-components/FooterLegend.ts b/src/deck-components/FooterLegend.ts index 40ebc9f..cd53197 100644 --- a/src/deck-components/FooterLegend.ts +++ b/src/deck-components/FooterLegend.ts @@ -1,3 +1,43 @@ +export enum GamepadButton { + INVALID, + OK, + CANCEL, + SECONDARY, + OPTIONS, + BUMPER_LEFT, + BUMPER_RIGHT, + TRIGGER_LEFT, + TRIGGER_RIGHT, + DIR_UP, + DIR_DOWN, + DIR_LEFT, + DIR_RIGHT, + SELECT, + START, + LSTICK_CLICK, + RSTICK_CLICK, + LSTICK_TOUCH, + RSTICK_TOUCH, + LPAD_TOUCH, + LPAD_CLICK, + RPAD_TOUCH, + RPAD_CLICK, + REAR_LEFT_UPPER, + REAR_LEFT_LOWER, + REAR_RIGHT_UPPER, + REAR_RIGHT_LOWER, + STEAM_GUIDE, + STEAM_QUICK_MENU +} + +export interface GamepadEventDetail { + button: number; + is_repeat?: boolean; + source: number; +} + +export type GamepadEvent = CustomEvent + export interface FooterLegendProps { actionDescriptionMap?: unknown; onOKActionDescription?: string; @@ -5,14 +45,14 @@ export interface FooterLegendProps { onSecondaryActionDescription?: string; onOptionsActionDescription?: string; onMenuActionDescription?: string; - onButtonDown?: () => void; - onButtonUp?: () => void; - onOKButton?: () => void; - onCancelButton?: () => void; - onSecondaryButton?: () => void; - onOptionsButton?: () => void; - onGamepadDirection?: () => void; - onGamepadFocus?: () => void; - onGamepadBlur?: () => void; - onMenuButton?: () => void; + onButtonDown?: (evt: GamepadEvent) => void; + onButtonUp?: (evt: GamepadEvent) => void; + onOKButton?: (evt: GamepadEvent) => void; + onCancelButton?: (evt: GamepadEvent) => void; + onSecondaryButton?: (evt: GamepadEvent) => void; + onOptionsButton?: (evt: GamepadEvent) => void; + onGamepadDirection?: (evt: GamepadEvent) => void; + onGamepadFocus?: (evt: GamepadEvent) => void; + onGamepadBlur?: (evt: GamepadEvent) => void; + onMenuButton?: (evt: GamepadEvent) => void; } \ No newline at end of file