Trait egui_bind::BindTarget

source ·
pub trait BindTarget: Clone {
    const IS_KEY: bool;
    const IS_POINTER: bool;
    const CLEARABLE: bool;

    // Required methods
    fn set_key(&mut self, key: Key, modifiers: Modifiers);
    fn set_pointer(&mut self, button: PointerButton, modifiers: Modifiers);
    fn clear(&mut self);
    fn format(&self) -> String;
    fn down(&self, ctx: &Context) -> bool;
    fn pressed(&self, ctx: &Context) -> bool;
    fn released(&self, ctx: &Context) -> bool;
}
Expand description

Type that can be used as a bind target

Required Associated Constants§

source

const IS_KEY: bool

Can accept key bind?

source

const IS_POINTER: bool

Can accept pointer bind?

source

const CLEARABLE: bool

Can be cleared?

Required Methods§

source

fn set_key(&mut self, key: Key, modifiers: Modifiers)

Sets new key bind

source

fn set_pointer(&mut self, button: PointerButton, modifiers: Modifiers)

Sets new pointer bind

source

fn clear(&mut self)

Clears the bind

source

fn format(&self) -> String

Formats a bind to a string

source

fn down(&self, ctx: &Context) -> bool

Is bind down?

source

fn pressed(&self, ctx: &Context) -> bool

Was bind pressed this frame?

source

fn released(&self, ctx: &Context) -> bool

Was bind released this frame?

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BindTarget for Option<KeyOrPointer>

source§

const IS_KEY: bool = true

source§

const IS_POINTER: bool = true

source§

const CLEARABLE: bool = true

source§

fn set_key(&mut self, key: Key, _: Modifiers)

source§

fn set_pointer(&mut self, button: PointerButton, _: Modifiers)

source§

fn clear(&mut self)

source§

fn format(&self) -> String

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

source§

impl BindTarget for Option<PointerButton>

source§

const IS_KEY: bool = false

source§

const IS_POINTER: bool = true

source§

const CLEARABLE: bool = false

source§

fn set_key(&mut self, _: Key, _: Modifiers)

source§

fn set_pointer(&mut self, button: PointerButton, _: Modifiers)

source§

fn format(&self) -> String

source§

fn clear(&mut self)

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

source§

impl BindTarget for Option<Key>

source§

const IS_KEY: bool = true

source§

const IS_POINTER: bool = false

source§

const CLEARABLE: bool = true

source§

fn set_key(&mut self, key: Key, _: Modifiers)

source§

fn set_pointer(&mut self, _: PointerButton, _: Modifiers)

source§

fn format(&self) -> String

source§

fn clear(&mut self)

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

source§

impl BindTarget for PointerButton

source§

const IS_KEY: bool = false

source§

const IS_POINTER: bool = true

source§

const CLEARABLE: bool = false

source§

fn set_key(&mut self, _: Key, _: Modifiers)

source§

fn set_pointer(&mut self, button: PointerButton, _: Modifiers)

source§

fn clear(&mut self)

source§

fn format(&self) -> String

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

source§

impl BindTarget for Key

source§

const IS_KEY: bool = true

source§

const IS_POINTER: bool = false

source§

const CLEARABLE: bool = false

source§

fn set_key(&mut self, key: Key, _: Modifiers)

source§

fn set_pointer(&mut self, _: PointerButton, _: Modifiers)

source§

fn format(&self) -> String

source§

fn clear(&mut self)

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

source§

impl<B: BindTarget> BindTarget for (B, Modifiers)

source§

const IS_KEY: bool = B::IS_KEY

source§

const IS_POINTER: bool = B::IS_POINTER

source§

const CLEARABLE: bool = false

source§

fn set_key(&mut self, key: Key, modifiers: Modifiers)

source§

fn set_pointer(&mut self, button: PointerButton, modifiers: Modifiers)

source§

fn clear(&mut self)

source§

fn format(&self) -> String

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

source§

impl<B: BindTarget> BindTarget for Option<(B, Modifiers)>

source§

const IS_KEY: bool = B::IS_KEY

source§

const IS_POINTER: bool = B::IS_POINTER

source§

const CLEARABLE: bool = true

source§

fn set_key(&mut self, key: Key, modifiers: Modifiers)

source§

fn set_pointer(&mut self, button: PointerButton, modifiers: Modifiers)

source§

fn clear(&mut self)

source§

fn format(&self) -> String

source§

fn down(&self, ctx: &Context) -> bool

source§

fn pressed(&self, ctx: &Context) -> bool

source§

fn released(&self, ctx: &Context) -> bool

Implementors§