mirror of
https://github.com/bevyengine/bevy
synced 2025-01-09 03:38:55 +00:00
40 lines
1.2 KiB
Rust
40 lines
1.2 KiB
Rust
|
use bevy_ecs::event::Event;
|
||
|
use bevy_reflect::{FromReflect, Reflect, ReflectFromReflect};
|
||
|
|
||
|
#[cfg(feature = "serialize")]
|
||
|
use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
|
||
|
|
||
|
/// Touchpad magnification event with two-finger pinch gesture.
|
||
|
///
|
||
|
/// Positive delta values indicate magnification (zooming in) and
|
||
|
/// negative delta values indicate shrinking (zooming out).
|
||
|
///
|
||
|
/// ## Platform-specific
|
||
|
///
|
||
|
/// - Only available on **`macOS`**.
|
||
|
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
|
||
|
#[reflect(Debug, PartialEq, FromReflect)]
|
||
|
#[cfg_attr(
|
||
|
feature = "serialize",
|
||
|
derive(serde::Serialize, serde::Deserialize),
|
||
|
reflect(Serialize, Deserialize)
|
||
|
)]
|
||
|
pub struct TouchpadMagnify(pub f32);
|
||
|
|
||
|
/// Touchpad rotation event with two-finger rotation gesture.
|
||
|
///
|
||
|
/// Positive delta values indicate rotation counterclockwise and
|
||
|
/// negative delta values indicate rotation clockwise.
|
||
|
///
|
||
|
/// ## Platform-specific
|
||
|
///
|
||
|
/// - Only available on **`macOS`**.
|
||
|
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
|
||
|
#[reflect(Debug, PartialEq, FromReflect)]
|
||
|
#[cfg_attr(
|
||
|
feature = "serialize",
|
||
|
derive(serde::Serialize, serde::Deserialize),
|
||
|
reflect(Serialize, Deserialize)
|
||
|
)]
|
||
|
pub struct TouchpadRotate(pub f32);
|