ragnarok/source.rs
1use crate::{
2 CursorPoint,
3 NameOfEvent,
4};
5
6pub trait SourceEvent: Clone + PartialEq {
7 type Name: NameOfEvent;
8
9 fn is_pressed(&self) -> bool;
10 fn is_moved(&self) -> bool;
11 fn is_touch_released(&self) -> bool;
12
13 fn try_location(&self) -> Option<CursorPoint>;
14
15 fn as_event_name(&self) -> Self::Name;
16}