//! No-op stub for non-Linux platforms.
//!
//! On macOS and Windows, Tauri's global-shortcut plugin handles hotkeys
//! natively. This stub exists so the crate compiles on all platforms.
//!
//! The signature here mirrors the Linux backend so the consumer (the
//! Tauri command layer) can use the same call shape on every platform:
//! `EvdevHotkeyListener::start(...).await` and `listener.stop().await`.

use tokio::sync::mpsc;

use crate::HotkeyCombo;

/// Events emitted by the hotkey listener.
#[derive(Debug, Clone)]
pub enum HotkeyEvent {
    Pressed,
    Released,
}

/// Stub listener that does nothing on non-Linux platforms.
pub struct EvdevHotkeyListener;

impl EvdevHotkeyListener {
    /// Mirrors the Linux backend's async constructor so consumers can
    /// `await` the same call shape regardless of platform.
    pub async fn start(_combo: HotkeyCombo, _event_tx: mpsc::Sender<HotkeyEvent>) -> Self {
        tracing::info!("evdev hotkey listener is a no-op on this platform");
        Self
    }

    pub fn set_hotkey(&self, _combo: HotkeyCombo) {}

    /// Consuming stop mirrors the Linux backend so callers can rely on
    /// the listener being unusable after shutdown on every platform.
    pub async fn stop(self) {}
}
