mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-17 16:38:28 +00:00
Merge pull request #135 from malikolivier/mouse-helper-functions
Wrap mouse helper functions: is_mouse_double_clicked, is_mouse_released
This commit is contained in:
commit
216e97a2b2
12
src/lib.rs
12
src/lib.rs
@ -268,6 +268,18 @@ impl ImGui {
|
||||
sys::igIsMouseClicked(button as c_int, false)
|
||||
}
|
||||
}
|
||||
/// Returns `true` if the `button` provided as argument is being double-clicked.
|
||||
pub fn is_mouse_double_clicked(&self, button: ImMouseButton) -> bool {
|
||||
unsafe {
|
||||
sys::igIsMouseDoubleClicked(button as c_int)
|
||||
}
|
||||
}
|
||||
/// Returns `true` if the `button` provided as argument was released
|
||||
pub fn is_mouse_released(&self, button: ImMouseButton) -> bool {
|
||||
unsafe {
|
||||
sys::igIsMouseReleased(button as c_int)
|
||||
}
|
||||
}
|
||||
pub fn key_ctrl(&self) -> bool {
|
||||
let io = self.io();
|
||||
io.key_ctrl
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user