Something went wrong. Try again.
[AWIP] Local-first peer-to-peer connectivity and sharing across Android, Linux and Windows, made with Tauri
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141//! Semantic pointer, keyboard, touch, and gesture types.
#[derive(Clone, Copy, Debug, PartialEq)]pub struct Point { pub x: f64, pub y: f64,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum ButtonState { Down, Up,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum PointerButton { Primary, Secondary, Middle, Back, Forward, Other(u16),}
#[derive(Clone, Copy, Debug, PartialEq)]pub struct PointerMove { pub position: Point, pub relative: bool,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub struct PointerButtonEvent { pub button: PointerButton, pub state: ButtonState,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum WheelPhase { Started, Changed, Ended, None,}
#[derive(Clone, Copy, Debug, PartialEq)]pub struct Wheel { pub delta_x: f64, pub delta_y: f64, pub phase: WheelPhase,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub struct Modifiers(u8);
impl Modifiers { pub const NONE: Self = Self(0); pub const SHIFT: Self = Self(1 << 0); pub const CONTROL: Self = Self(1 << 1); pub const ALT: Self = Self(1 << 2); pub const META: Self = Self(1 << 3);
pub const fn empty() -> Self { Self::NONE }
pub const fn with(self, modifier: Self) -> Self { Self(self.0 | modifier.0) }
pub const fn contains(self, modifier: Self) -> bool { self.0 & modifier.0 == modifier.0 }}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum KeyState { Down, Up,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum KeyCode { Physical(u32), Enter, Escape, Tab, Backspace, Space, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Function(u8),}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub struct KeyEvent { pub code: KeyCode, pub state: KeyState, pub modifiers: Modifiers,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum TouchPhase { Started, Moved, Ended, Cancelled,}
#[derive(Clone, Copy, Debug, PartialEq)]pub struct Touch { pub pointer_id: u64, pub phase: TouchPhase, pub position: Point, pub pressure: f32,}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum GestureKind { Pinch, Rotate, Swipe, Custom(u16),}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum GesturePhase { Started, Changed, Ended, Cancelled,}
#[derive(Clone, Copy, Debug, PartialEq)]pub struct Gesture { pub kind: GestureKind, pub phase: GesturePhase, pub value: f32,}