diff options
author | HampusM <hampus@hampusmat.com> | 2023-11-27 22:15:33 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-11-27 22:15:33 +0100 |
commit | 7360e3086d5f3365813e8169bd17bcf347fa30c7 (patch) | |
tree | 48adc0e6af655b456becd6b55254faccbc39c27b /glfw/src | |
parent | 89c6739581cce30dda05ad8016a553a1dd10a5d8 (diff) |
docs(glfw): add InputMode & CursorMode doc comments
Diffstat (limited to 'glfw/src')
-rw-r--r-- | glfw/src/window.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/glfw/src/window.rs b/glfw/src/window.rs index bd8b78b..b1c94a2 100644 --- a/glfw/src/window.rs +++ b/glfw/src/window.rs @@ -365,9 +365,31 @@ pub struct Size #[repr(i32)] pub enum InputMode { + /// When sticky keys mode is enabled, the pollable state of a key will remain + /// [`KeyState::Pressed`] until the state of that key is polled with + /// [`Window::get_key`]. Once it has been polled, if a key release event had been + /// processed in the meantime, the state will reset to [`KeyState::Released`], + /// otherwise it will remain [`KeyState::Pressed`]. StickyKeys = crate::ffi::GLFW_STICKY_KEYS, + + /// When sticky mouse buttons mode is enabled, the pollable state of a mouse button + /// will remain [`MouseButtonState::Pressed`] until the state of that button is + /// polled with [`Window::get_mouse_button`]. Once it has been polled, if a mouse + /// button release event had been processed in the meantime, the state will reset + /// to [`MouseButtonState::Released`], otherwise it will remain + /// [`MouseButton::Pressed`]. StickyMouseButtons = crate::ffi::GLFW_STICKY_MOUSE_BUTTONS, + LockKeyMods = crate::ffi::GLFW_LOCK_KEY_MODS, + + /// When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can be + /// enabled if available. + /// + /// Raw mouse motion is closer to the actual motion of the mouse across a surface. It + /// is not affected by the scaling and acceleration applied to the motion of the + /// desktop cursor. That processing is suitable for a cursor while raw motion is + /// better for controlling for example a 3D camera. Because of this, raw mouse motion + /// is only provided when the cursor is disabled. RawMouseMotion = crate::ffi::GLFW_RAW_MOUSE_MOTION, } @@ -375,8 +397,15 @@ pub enum InputMode #[repr(i32)] pub enum CursorMode { + /// Hides and grabs the cursor, providing virtual and unlimited cursor movement. This + /// is useful for implementing for example 3D camera controls. Disabled = crate::ffi::GLFW_CURSOR_DISABLED, + + /// Makes the cursor invisible when it is over the content area of the window but + /// does not restrict the cursor from leaving. Hidden = crate::ffi::GLFW_CURSOR_HIDDEN, + + /// Makes the cursor visible and behaving normally. Normal = crate::ffi::GLFW_CURSOR_NORMAL, } |