ui_events/lib.rs
1// Copyright 2025 the UI Events Authors
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3
4//! A cross-platform input event abstraction modeled after W3C UI Events specifications.
5//!
6//! Provides common vocabulary types for working with pointer events (mouse, touch, pen) and
7//! keyboard events in a platform-agnostic way. The crate aims to closely follow W3C standards
8//! while remaining practical for native application development.
9//!
10//! Includes support for:
11//!
12//! - Pointer events (down/move/up, pressure, tilt, etc.)
13//! - Keyboard events (key codes, modifiers, location)
14//!
15//! For integration with [`winit`], use the companion [`ui-events-winit`] adapter crate.
16//!
17//! ## Features
18//!
19//! - `std` (enabled by default): Use the Rust standard library.
20//! - `kurbo`: Add convenience methods for easily converting dpi positions to kurbo `Point`s.
21//!
22//! [`ui-events-winit`]: https://docs.rs/ui-events-winit/
23//! [`winit`]: https://docs.rs/winit/
24// LINEBENDER LINT SET - lib.rs - v3
25// See https://linebender.org/wiki/canonical-lints/
26// These lints shouldn't apply to examples or tests.
27#![cfg_attr(not(test), warn(unused_crate_dependencies))]
28// These lints shouldn't apply to examples.
29#![warn(clippy::print_stdout, clippy::print_stderr)]
30// Targeting e.g. 32-bit means structs containing usize can give false positives for 64-bit.
31#![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))]
32// END LINEBENDER LINT SET
33#![no_std]
34
35pub mod keyboard;
36pub mod pointer;
37
38mod scroll;
39
40pub use scroll::ScrollDelta;