Struct cogs_gamedev::controls::PollingInputHandler[][src]

pub struct PollingInputHandler<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> { /* fields omitted */ }
Expand description

Polling-based input handler. See module-level documentation for more.

Implementations

Create a new PollingInputHandler without any controls.

Create a new PollingInputHandler with the specified controls. The HashMap in should map inputs to the controls you want them to actuate.

Update the input handler. You MUST CALL THIS FIRST THING in your game loop. Otherwise things won’t get updated correctly.

Trait Implementations

EnumMap doesn’t implement Clone so we do it ourselves

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Is this input pressed down? i.e. is the player pressing the button?

Is this input released? i.e. is the player not pressing the button?

Is this input being clicked down? i.e. was it up last frame, but down this frame?

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 resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.