Trait InputCondition

Source
pub trait InputCondition:
    Sync
    + Send
    + Debug
    + 'static {
    // Required method
    fn evaluate(
        &mut self,
        action_map: &ActionMap,
        time: &Time<Virtual>,
        value: ActionValue,
    ) -> ActionState;

    // Provided method
    fn kind(&self) -> ConditionKind { ... }
}
Expand description

Defines how input activates.

Conditions analyze the input, checking for minimum actuation values and validating patterns like short taps, prolonged holds, or the typical “press” or “release” events.

Can be applied both to inputs and actions. See ActionBinding::with_conditions and BindingBuilder::with_conditions.

Required Methods§

Source

fn evaluate( &mut self, action_map: &ActionMap, time: &Time<Virtual>, value: ActionValue, ) -> ActionState

Returns calculates state.

actions is a state of other actions within the currently evaluating context.

Provided Methods§

Source

fn kind(&self) -> ConditionKind

Returns how the condition is combined with others.

Implementors§