[][src]Struct vigem::types::vigem::Vigem

pub struct Vigem {
    pub vigem: Rc<Box<PVIGEM_CLIENT>>,
    // some fields omitted
}

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]

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]

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]

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]

Register notification, callback will be called as controller got force-feedbacked

Trait Implementations

impl Drop for Vigem[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.