touchscreen

Crates.iotouchscreen
lib.rstouchscreen
version0.1.0
sourcesrc
created_at2023-11-08 08:11:24.908559
updated_at2023-11-08 08:11:24.908559
descriptionDecorates embedded-graphics to enable touch interactivity
homepagehttps://github.com/tommy-gilligan/touchscreen
repositoryhttps://github.com/tommy-gilligan/touchscreen.git
max_upload_size
id1028845
size18,092
Tommy G (tommy-gilligan)

documentation

README

Touchscreen

A touchscreen is just a screen that you can touch. Central to this crate is the Touchscreen trait:

pub trait Touchscreen:
    embedded_graphics_core::prelude::DrawTarget +
    embedded_graphics_core::prelude::OriginDimensions {
        type TouchError;

        fn get_touch_event(&mut self) -> Result<Option<TouchEvent>, Self::TouchError>;
    }

It is overly simple right now, it is more of a tentative starting point. There are 2 implementations, which can be selected by feature flags:

  • red-screen: This is a screen that I had lying around which combines XPT2046 (touch) with ILI9488 (screen)
  • web-screen: A screen that marries WebSimulatorDisplay with mouse event handlers bound to a container element.

Todo

  • Support touchscreens that can signal touch with interrupt
  • Add an SDL touchscreen
  • Clean up web_screen, propagate mouse handling errors
Commit count: 19

cargo fmt