Skip to content

Commit

Permalink
docs: add comment for pub struct and enum
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisflatley committed Oct 17, 2023
1 parent bb349df commit 0c45105
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,23 @@ mod platform_impl;
pub use self::error::*;
use hotkey::HotKey;

/// Describes the state of the [`HotKey`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum HotKeyState {
/// The [`HotKey`] is pressed (the key is down).
Pressed,
/// The [`HotKey`] is released (the key is up).
Released,
}

/// Contains the id of the triggered [`HotKey`].
/// Describes a global hotkey event emitted when a [`HotKey`] is pressed.
/// Contains the id of the triggered [`HotKey`] and the state.
/// Describes a global hotkey event emitted when a [`HotKey`] is pressed or released.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct GlobalHotKeyEvent {
/// Id of the associated [`HotKey`].
pub id: u32,
/// State of the associated [`HotKey`].
/// The event was triggered by the [`HotKey`] changing to this state.
pub state: HotKeyState,
}

Expand Down

0 comments on commit 0c45105

Please sign in to comment.