#[repr(C, packed(1))]pub struct Ds4ReportExData {Show 22 fields
pub thumb_lx: u8,
pub thumb_ly: u8,
pub thumb_rx: u8,
pub thumb_ry: u8,
pub buttons: u16,
pub special: u8,
pub trigger_l: u8,
pub trigger_r: u8,
pub timestamp: u16,
pub battery_lvl: u8,
pub gyro_x: i16,
pub gyro_y: i16,
pub gyro_z: i16,
pub accel_x: i16,
pub accel_y: i16,
pub accel_z: i16,
pub _unknown1: [u8; 5],
pub battery_lvl_special: u8,
pub _unknown2: [u8; 2],
pub touch_packets_n: u8,
pub current_touch: Ds4Touch,
pub previous_touch: [Ds4Touch; 2],
}Expand description
Represents the complete, extended input state of a virtual DualShock 4 controller.
This struct is used for advanced scenarios that require simulating motion controls
(gyroscope and accelerometer) and detailed touchpad activity. It contains all the
fields from the standard Ds4Report plus additional data.
Fields§
§thumb_lx: u8§thumb_ly: u8§thumb_rx: u8§thumb_ry: u8§special: u8§trigger_l: u8§trigger_r: u8§timestamp: u16§battery_lvl: u8§gyro_x: i16§gyro_y: i16§gyro_z: i16§accel_x: i16§accel_y: i16§accel_z: i16§_unknown1: [u8; 5]§battery_lvl_special: u8§_unknown2: [u8; 2]§touch_packets_n: u8§current_touch: Ds4Touch§previous_touch: [Ds4Touch; 2]Implementations§
Source§impl Ds4ReportExData
impl Ds4ReportExData
Sourcepub fn as_report(&self) -> &Ds4Report
pub fn as_report(&self) -> &Ds4Report
Returns an immutable reference to the standard Ds4Report portion of this extended report.
This is safe because Ds4ReportExData is #[repr(C)] and starts with the exact
same fields as Ds4Report.
Sourcepub fn as_report_mut(&mut self) -> &mut Ds4Report
pub fn as_report_mut(&mut self) -> &mut Ds4Report
Returns a mutable reference to the standard Ds4Report portion of this extended report.
This allows using helpers like set_dpad on the extended report.
Trait Implementations§
Source§impl Clone for Ds4ReportExData
impl Clone for Ds4ReportExData
Source§fn clone(&self) -> Ds4ReportExData
fn clone(&self) -> Ds4ReportExData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for Ds4ReportExData
impl Default for Ds4ReportExData
impl Copy for Ds4ReportExData
Auto Trait Implementations§
impl Freeze for Ds4ReportExData
impl RefUnwindSafe for Ds4ReportExData
impl Send for Ds4ReportExData
impl Sync for Ds4ReportExData
impl Unpin for Ds4ReportExData
impl UnwindSafe for Ds4ReportExData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more