Support arbitrary flag widths
Use u8 for joystick::HatState