Trait GCDevice

Source
pub unsafe trait GCDevice: NSObjectProtocol {
    // Provided methods
    unsafe fn handlerQueue(&self) -> Retained<DispatchQueue>
       where Self: Sized + Message { ... }
    unsafe fn setHandlerQueue(&self, handler_queue: &DispatchQueue)
       where Self: Sized + Message { ... }
    unsafe fn vendorName(&self) -> Option<Retained<NSString>>
       where Self: Sized + Message { ... }
    unsafe fn productCategory(&self) -> Retained<NSString>
       where Self: Sized + Message { ... }
    unsafe fn physicalInputProfile(&self) -> Retained<GCPhysicalInputProfile>
       where Self: Sized + Message { ... }
}
Available on crate feature GCDevice only.
Expand description

Provided Methods§

Source

unsafe fn handlerQueue(&self) -> Retained<DispatchQueue>
where Self: Sized + Message,

Available on crate feature dispatch2 only.

The dispatch queue that element value change handlers are submitted on. The default queue is main, and setting this to any other queue will make value change handlers dispatch async on the given queue. This is useful if the main game loop of the application is not on main, or if input logic is handled on another thread from the main game loop.

See: GCControllerAxisInput.valueChangedHandler

See: GCControllerButtonInput.valueChangedHandler

See: GCControllerButtonInput.pressedChangedHandler

See: GCControllerDirectionPad.valueChangedHandler

See: GCMotion.valueChangedHandler

Source

unsafe fn setHandlerQueue(&self, handler_queue: &DispatchQueue)
where Self: Sized + Message,

Available on crate feature dispatch2 only.

Setter for handlerQueue.

Source

unsafe fn vendorName(&self) -> Option<Retained<NSString>>
where Self: Sized + Message,

A vendor supplied name. May be nil, and is not guaranteed to be unique. This should not be used as a key in a dictionary, but simply as a way to present some basic information about the device in testing or to the user.

Source

unsafe fn productCategory(&self) -> Retained<NSString>
where Self: Sized + Message,

The product category the device belongs to. This is useful for setting appropriate UI elements based on what type of device is connected.

See: GCProductCategories.h

Source

unsafe fn physicalInputProfile(&self) -> Retained<GCPhysicalInputProfile>
where Self: Sized + Message,

👎Deprecated: Use the physicalInputProfile property on GCController instead. For GCKeyboard, use the keyboardInput property. For GCMouse, use the mouseInput property.
Available on crate feature GCPhysicalInputProfile only.

Gets the physical input profile for the device.

Note: This is equivalent to the controller’s gamepad, microGamepad, or extendedGamepad instance.

See: GCController.microGamepad

See: GCController.extendedGamepad

Trait Implementations§

Source§

impl ProtocolType for dyn GCDevice

Source§

const NAME: &'static str = "GCDevice"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn GCDevice
where T: ?Sized + Message + GCDevice,

Implementations on Foreign Types§

Source§

impl<T> GCDevice for ProtocolObject<T>
where T: ?Sized + GCDevice,

Implementors§

Source§

impl GCDevice for GCController

Available on crate feature GCController only.
Source§

impl GCDevice for GCKeyboard

Available on crate feature GCKeyboard only.
Source§

impl GCDevice for GCMouse

Available on crate feature GCMouse only.
Source§

impl GCDevice for GCRacingWheel

Available on crate feature GCRacingWheel only.