logo
pub enum JoypadTouch {
    Disabled,
    Dpad,
    Joystick {
        distance: i32,
    },
    Swipe {
        speed: i32,
    },
}
Expand description

Representing the touch input modes for a Touchscreen Joypad for use in the Joypad virtual controller.

Variants

Disabled

Touch input is disabled for joypad. The default. It is advised that JoypadTouch be set in Factory based on device interrogation.

Dpad

The screen is split into five fixed position regions corresponding to directions, only one can be down at a time. A single fire button (primary) is located in the center.

Joystick

Fields

distance: i32

Distance value

A self centering joystick represented by a constant drag / touch. A drag can begin anywhere. Distance sets the minimum vector length that determines movement. 20 pixels is the default. If the horizontal drag vector is > distance then left or right is down. If the vertical drag vector is > distance then up or down is down. Any tap of less than 200ms triggers primary down.

Swipe

Fields

speed: i32

Swipe speed value

A swipe can begin anywhere. Speed sets the minimum vector length (pixels per second) that determines movement. 100 pixels is the default. If the horizontal swipe vector is > speed then left or right is down. If the vertical swipe vector is > speed then up or down is down. Any tap of less than 200ms triggers primary down.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.