ragnarok/
source.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{
    CursorPoint,
    NameOfEvent,
};

pub trait SourceEvent: Clone + PartialEq {
    type Name: NameOfEvent;

    fn is_pressed(&self) -> bool;
    fn is_moved(&self) -> bool;

    fn try_cursor(&self) -> Option<CursorPoint>;

    fn as_event_name(&self) -> Self::Name;
}