mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-22 12:32:02 +00:00
rust: delete unused event.rs
This commit is contained in:
parent
c69b1aaa5e
commit
1667f45474
@ -1,28 +0,0 @@
|
||||
use core::convert::TryInto;
|
||||
|
||||
use crate::{error, ui::geometry::Point};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
pub enum TouchEvent {
|
||||
/// A person has started touching the screen at given absolute coordinates.
|
||||
/// `TouchMove` will usually follow, and `TouchEnd` should finish the
|
||||
/// interaction.
|
||||
TouchStart(Point),
|
||||
/// Touch has moved into a different point on the screen.
|
||||
TouchMove(Point),
|
||||
/// Touch has ended at a point on the screen.
|
||||
TouchEnd(Point),
|
||||
}
|
||||
|
||||
impl TouchEvent {
|
||||
pub fn new(event: u32, x: u32, y: u32) -> Result<Self, error::Error> {
|
||||
let point = Point::new(x.try_into()?, y.try_into()?);
|
||||
let result = match event {
|
||||
1 => Self::TouchStart(point),
|
||||
2 => Self::TouchMove(point),
|
||||
4 => Self::TouchEnd(point),
|
||||
_ => return Err(error::Error::OutOfRange),
|
||||
};
|
||||
Ok(result)
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@
|
||||
pub mod bootloader;
|
||||
pub mod component;
|
||||
pub mod constant;
|
||||
pub mod event;
|
||||
pub mod theme;
|
||||
|
||||
#[cfg(feature = "micropython")]
|
||||
|
Loading…
Reference in New Issue
Block a user