pub struct EventData {Show 16 fields
pub event_type: String,
pub target: u64,
pub current_target: u64,
pub local: (f64, f64),
pub client: (f64, f64),
pub key: String,
pub shift: bool,
pub ctrl: bool,
pub alt: bool,
pub super_: bool,
pub button: i64,
pub delta: (f64, f64),
pub value: String,
pub default_prevented: bool,
pub propagation_stopped: bool,
pub immediate_stopped: bool,
}Expand description
The full event payload delivered to a handler. Positional / key / button /
delta / value fields carry meaning only for the event types that produce
them (a keydown has key + modifiers, a wheel has delta, an
input / change has value, and so on); unused fields stay at their
defaults.
Fields§
§event_type: StringEvent type name ("click", "keydown", "wheel", …).
target: u64The node the event originally targeted (packed handle).
current_target: u64The node whose handler is currently running (packed handle). The driver updates this as it walks the propagation path.
local: (f64, f64)Pointer position relative to the target’s top-left, logical pixels.
client: (f64, f64)Pointer position in window (client) coordinates, logical pixels.
key: StringLogical key for keyboard events ("a", "Enter", "ArrowLeft").
shift: boolShift held.
ctrl: boolControl held.
alt: boolAlt / Option held.
super_: boolSuper / Cmd / Windows held.
Pointer button: 0 primary, 1 middle, 2 secondary, -1 none.
delta: (f64, f64)Wheel scroll delta, logical pixels.
value: StringText value for input / change events.
default_prevented: boolSet by prevent_default: the event’s default action is cancelled.
propagation_stopped: boolSet by stop_propagation: no further nodes receive the event.
immediate_stopped: boolSet by stop_immediate_propagation: no further handlers run at all.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventData
impl RefUnwindSafe for EventData
impl Send for EventData
impl Sync for EventData
impl Unpin for EventData
impl UnsafeUnpin for EventData
impl UnwindSafe for EventData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.