freya_core/events/
platform_event.rs1use std::path::PathBuf;
2
3use freya_elements::events::keyboard::{
4 Code,
5 Key,
6 Modifiers,
7};
8use freya_native_core::events::EventName;
9use torin::prelude::*;
10use winit::event::{
11 Force,
12 MouseButton,
13 TouchPhase,
14};
15
16#[derive(Clone, Debug)]
18pub struct PlatformEvent {
19 pub name: EventName,
20 pub data: PlatformEventData,
21}
22
23#[derive(Clone, Debug)]
25pub enum PlatformEventData {
26 Mouse {
28 cursor: CursorPoint,
29 button: Option<MouseButton>,
30 },
31 Wheel {
33 scroll: CursorPoint,
34 cursor: CursorPoint,
35 },
36 Keyboard {
38 key: Key,
39 code: Code,
40 modifiers: Modifiers,
41 },
42 Touch {
44 location: CursorPoint,
45 finger_id: u64,
46 phase: TouchPhase,
47 force: Option<Force>,
48 },
49 File {
51 cursor: CursorPoint,
52 file_path: Option<PathBuf>,
53 },
54}