diff --git a/src/structs/input.rs b/src/structs/input.rs index 6e9e98f..9b64627 100644 --- a/src/structs/input.rs +++ b/src/structs/input.rs @@ -164,6 +164,16 @@ impl ButtonState { self.state > 0 } + /// Returns whether there is a horizontal scroll to the right. + pub fn scroll_right(&self) -> bool { + self.state > 0 + } + + /// Returns whether there is a horizontal scroll to the left. + pub fn scroll_left(&self) -> bool { + self.state < 0 + } + /// Returns the raw state. pub fn state(&self) -> i32 { self.state