[−][src]Struct vigem::types::vigem::Vigem
Fields
vigem: Rc<Box<PVIGEM_CLIENT>>
Implementations
impl Vigem
[src]
pub fn new() -> Self
[src]
Create a new Vigem instance and allocates it
pub fn from_raw(vigem: PVIGEM_CLIENT) -> Self
[src]
You can build safe Vigem
abstraction from PVIGEM_CLIENT
, which you can obtain from notifications
pub fn connect(&mut self) -> Result<(), VigemError>
[src]
Initializes the driver object and establishes a connection to the emulation bus driver. Returns an error if no compatible bus device has been found.
pub fn target_add(&mut self, target: &mut Target) -> Result<(), VigemError>
[src]
Adds a provided target device to the bus driver, which is equal to a device plug-in event of a physical hardware device. This function blocks until the target device is in full operational mode.
pub fn add_async(
&mut self,
target: &Target,
func: PFN_VIGEM_TARGET_ADD_RESULT
) -> Result<(), VigemError>
[src]
&mut self,
target: &Target,
func: PFN_VIGEM_TARGET_ADD_RESULT
) -> Result<(), VigemError>
Add the target but async. As it ready callback with PVIGEM_CLIENT
, PVIGEM_TARGET
, PVIGEM_ERORR
will be called
pub fn target_remove(&mut self, target: &Target) -> Result<(), VigemError>
[src]
Removes a provided target device from the bus driver, which is equal to a device unplug event of a physical hardware device. The target device object may be reused
pub fn free(&mut self)
[src]
Free Vigem object, dont forget to remove all targets!
pub fn disconnect(&mut self)
[src]
Disconnect from the BUS driver
pub fn xbox_get_user_index(&mut self, target: &Target) -> u32
[src]
Get xbox index
pub fn update<T: Reportable>(
&mut self,
target: &Target,
report: &T
) -> Result<(), VigemError>
[src]
&mut self,
target: &Target,
report: &T
) -> Result<(), VigemError>
Send report, report type depends on target type
For DualShock4, type is: DSReport
For Xbox, type is XUSBReport
Report:
s_thumb
- can be from -32,768 to 32,767
trigger
can be from 0 to 100
pub fn x360_register_notification<T: Sized>(
&mut self,
target: &Target,
func: PFN_VIGEM_X360_NOTIFICATION,
data: T
) -> Result<(), VigemError>
[src]
&mut self,
target: &Target,
func: PFN_VIGEM_X360_NOTIFICATION,
data: T
) -> Result<(), VigemError>
Register notification, callback will be called as controller got force-feedbacked
pub fn ds4_register_notification(
&mut self,
target: &Target,
func: PFN_VIGEM_DS4_NOTIFICATION,
data: i32
) -> Result<(), VigemError>
[src]
&mut self,
target: &Target,
func: PFN_VIGEM_DS4_NOTIFICATION,
data: i32
) -> Result<(), VigemError>
Register notification, callback will be called as controller got force-feedbacked
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Vigem
impl !Send for Vigem
impl !Sync for Vigem
impl Unpin for Vigem
impl UnwindSafe for Vigem
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,