37 lines
1.7 KiB
Rust
37 lines
1.7 KiB
Rust
// SPDX-License-Identifier: LGPL-2.1-only
|
|
// Copyright (C) 2026 Liberux Labs, S. L. <info@liberux.net>
|
|
|
|
//! Input-event layer.
|
|
//!
|
|
//! Three Wayland input sources — `wl_keyboard`, `wl_pointer`,
|
|
//! `wl_touch` — land in their respective submodules and translate
|
|
//! into ltk-level actions. Keyboard is standalone (it drives focus
|
|
//! and text insertion, no gesture lifecycle); pointer and touch share
|
|
//! the [`gesture::GestureState`] state machine so press → move →
|
|
//! release logic (long-press, slider drag, scroll, swipe commit, tap,
|
|
//! drop) is written once and fed by both sources.
|
|
//!
|
|
//! The [`dispatch`] submodule turns gesture outcomes into concrete
|
|
//! side-effects on [`AppData`](crate::event_loop::AppData): pending
|
|
//! messages, app callbacks, surface redraws, cache invalidation. It
|
|
//! is `pub( super )`-scoped so pointer.rs and touch.rs can call it
|
|
//! without exposing the helpers at the crate root.
|
|
//!
|
|
//! With [`GestureState`] owning the press / move / release lifecycle
|
|
//! and [`dispatch`] owning the side-effects, the Wayland-facing
|
|
//! handlers stay small and a hypothetical new input source (stylus,
|
|
//! gamepad) can plug in by feeding the state machine the same way.
|
|
|
|
pub( crate ) mod gesture;
|
|
pub( crate ) mod keyboard;
|
|
pub( crate ) mod pointer;
|
|
pub( crate ) mod touch;
|
|
pub( crate ) mod dispatch;
|
|
|
|
// `GestureState` is the only type consumers outside `input/` need —
|
|
// `AppData` stores one per `SurfaceState` and the long-press deadline
|
|
// poller reaches through it. The rest (`MoveOutcome`, `PressOutcome`,
|
|
// `ReleaseEvent`, `SwipeConfig`) stay at `super::gesture::*` because
|
|
// only the sibling modules in `input/` touch them.
|
|
pub use gesture::GestureState;
|