1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

feat: add documentation to structs (#7800)

feat: add documentation to structs
This commit is contained in:
n4n5
2026-01-05 04:11:14 -07:00
committed by GitHub
parent 0a5cf3156e
commit 06e491c5ec
2 changed files with 16 additions and 0 deletions

View File

@@ -608,6 +608,13 @@ pub const NUM_POINTER_BUTTONS: usize = 5;
///
/// The best way to compare [`Modifiers`] is by using [`Modifiers::matches_logically`] or [`Modifiers::matches_exact`].
///
/// To access the [`Modifiers`] you can use the [`crate::Context::input`] function
///
/// ```rust
/// # let ctx = egui::Context::default();
/// let modifiers = ctx.input(|i| i.modifiers);
/// ```
///
/// NOTE: For cross-platform uses, ALT+SHIFT is a bad combination of modifiers
/// as on mac that is how you type special characters,
/// so those key presses are usually not reported to egui.

View File

@@ -970,6 +970,15 @@ impl PointerEvent {
}
/// Mouse or touch state.
///
/// To access the methods of [`PointerState`] you can use the [`crate::Context::input`] function
///
/// ```rust
/// # let ctx = egui::Context::default();
/// let latest_pos = ctx.input(|i| i.pointer.latest_pos());
/// let is_pointer_down = ctx.input(|i| i.pointer.any_down());
/// ```
///
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct PointerState {