use crate::{EvtCommit, EvtKey, EvtMouse, EvtTouch, EvtWheel, Platform};
pub trait IntoEvt<P: Platform, T> {
fn to_evt(&self, win: P::WinRef<'_>) -> Option<T>;
}
impl<P: Platform> IntoEvt<P, EvtCommit> for &EvtCommit {
fn to_evt(&self, _: <P as Platform>::WinRef<'_>) -> Option<EvtCommit> {
Some((*self).clone())
}
}
impl<P: Platform> IntoEvt<P, EvtKey> for &EvtKey {
fn to_evt(&self, _: <P as Platform>::WinRef<'_>) -> Option<EvtKey> {
Some((*self).clone())
}
}
impl<P: Platform> IntoEvt<P, EvtMouse> for &EvtMouse {
fn to_evt(&self, _: <P as Platform>::WinRef<'_>) -> Option<EvtMouse> {
Some((*self).clone())
}
}
impl<P: Platform> IntoEvt<P, EvtTouch> for &EvtTouch {
fn to_evt(&self, _: <P as Platform>::WinRef<'_>) -> Option<EvtTouch> {
Some((*self).clone())
}
}
impl<P: Platform> IntoEvt<P, EvtWheel> for &EvtWheel {
fn to_evt(&self, _: <P as Platform>::WinRef<'_>) -> Option<EvtWheel> {
Some((*self).clone())
}
}