mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
feat: add documentation to structs (#7800)
feat: add documentation to structs
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user