Skip to main content

hyprcorrect_platform/
lib.rs

1//! Platform layer for hyprcorrect: observe-only key capture, synthetic
2//! input, global hotkeys, frontmost-application detection, and the tray.
3//!
4//! Each capability sits behind a common interface backed by a per-OS
5//! implementation. See the "Platform layer" section of `DESIGN.md`.
6
7#[cfg(target_os = "linux")]
8pub mod linux;
9#[cfg(target_os = "macos")]
10pub mod macos;
11#[cfg(target_os = "windows")]
12pub mod windows;
13
14/// Human-readable name of the platform backend compiled into this build.
15pub fn backend_name() -> &'static str {
16    if cfg!(target_os = "linux") {
17        "linux/wayland"
18    } else if cfg!(target_os = "macos") {
19        "macos"
20    } else if cfg!(target_os = "windows") {
21        "windows (stub)"
22    } else {
23        "unsupported"
24    }
25}