-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Touchpad): Add Touchpad event type.
- Loading branch information
1 parent
7492d78
commit 3c03606
Showing
17 changed files
with
636 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::error::Error; | ||
|
||
use packed_struct::{PackedStruct, PackedStructSlice}; | ||
|
||
use crate::drivers::dualsense::hid_report::USBPackedInputDataReport; | ||
|
||
#[tokio::test] | ||
async fn test_ds_hid() -> Result<(), Box<dyn Error>> { | ||
let mut report = USBPackedInputDataReport::default(); | ||
println!("Before Report: {}", report.touch_data.touch_finger_data[0]); | ||
report.touch_data.touch_finger_data[0].set_y(1068); | ||
report.touch_data.touch_finger_data[0].set_x(1919); | ||
|
||
println!("After Report: {}", report.touch_data.touch_finger_data[0]); | ||
assert_eq!( | ||
report.touch_data.touch_finger_data[0] | ||
.pack_to_vec() | ||
.unwrap(), | ||
vec![0x80, 0x7F, 0xC7, 0x42] | ||
); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod report_descriptor; | ||
pub mod driver; | ||
pub mod hid_report; | ||
pub mod hid_report; | ||
mod hid_report_test; | ||
pub mod report_descriptor; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.