logo

Enum primitives::prelude::JoypadTouch[][src]

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

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

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.

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

Performs the conversion.

Performs the conversion.

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.