Skip to main content

parse_face_buttons

Function parse_face_buttons 

Source
pub fn parse_face_buttons(value: u8) -> Result<Vec<FaceButton>, FaceButtonError>
Expand description

Parses all active FaceButtons from a packed face-button byte.

Each bit in the byte corresponds to one or more buttons. Bit 6 (0x40) is reserved for the CTGP pause flag and is ignored here. If the upper nibble has any bits set (excluding bit 6) a FaceButton::Unknown entry is appended to signal unrecognized input.

ยงErrors

Returns FaceButtonError::NonExistentFaceButton if the byte is non-zero, bit 6 is not set, and no known button bits were matched.