pub struct InputHoldBuilder<'a> { /* private fields */ }
Expand description
Builder returned by on_hold
.
Implementations
sourceimpl<'a> InputHoldBuilder<'a>
impl<'a> InputHoldBuilder<'a>
sourcepub fn keys<C: KeyCombo>(self, combo: C) -> Self
pub fn keys<C: KeyCombo>(self, combo: C) -> Self
Add a list of Key
’s to the combination used.
Notes
- This adds to any previous
combo
call.
// Example Inputs
.keys(Qwerty::Q)
.keys((Qwerty::LCtrl, MouseButton::Left))
.keys(vec![Qwerty::LCtrl, Qwerty::A])
.keys([Qwerty::A, Qwerty::D])
sourcepub fn delay(self, delay: Option<Duration>) -> Self
pub fn delay(self, delay: Option<Duration>) -> Self
Set the delay (How long to be held before activation).
Default: None
sourcepub fn interval(self, intvl: Duration) -> Self
pub fn interval(self, intvl: Duration) -> Self
Set the interval.
Default: Duration::from_millis(15)
sourcepub fn call<F: FnMut(InputHookTarget, &LocalKeyState, Option<Duration>) -> InputHookCtrl + Send + 'static>(
self,
method: F
) -> Self
pub fn call<F: FnMut(InputHookTarget, &LocalKeyState, Option<Duration>) -> InputHookCtrl + Send + 'static>(
self,
method: F
) -> Self
Assign a function to call.
Notes
- Calling this multiple times will not add additional methods.
NoPass
varients ofInputHookCtrl
will be treated like their normal varients.
sourcepub fn finish(self) -> Result<InputHookID, InputError>
pub fn finish(self) -> Result<InputHookID, InputError>
Finish building, validate, and submit it to Input
.
Possible Errors
NoKeys
: No call tokey
orkeys
was made.NoMethod
: No method was added. Seecall
.NoTarget
: No call tobin()
orwindow()
was made.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for InputHoldBuilder<'a>
impl<'a> Send for InputHoldBuilder<'a>
impl<'a> !Sync for InputHoldBuilder<'a>
impl<'a> Unpin for InputHoldBuilder<'a>
impl<'a> !UnwindSafe for InputHoldBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more