cushy

Trait ModifiersExt

source
pub trait ModifiersExt {
    // Required methods
    fn primary(&self) -> bool;
    fn only_primary(&self) -> bool;
    fn only_shift(&self) -> bool;
    fn only_control(&self) -> bool;
    fn only_alt(&self) -> bool;
    fn only_super(&self) -> bool;
    fn word_select(&self) -> bool;
    fn possible_shortcut(&self) -> bool;
}
Expand description

Helper functions for [Modifiers] and [ModifiersState].

Required Methods§

source

fn primary(&self) -> bool

Returns true if the current state includes the platform’s primary shortcut key.

For Apple based platforms, this returns true if a “super” modifier is pressed. This corresponds to the Apple/Command key.

For all other platforms, this returns true if a control key is pressed.

source

fn only_primary(&self) -> bool

Returns true if only the primary modifier key is pressed.

source

fn only_shift(&self) -> bool

Returns true if only a shift modifier key is pressed.

source

fn only_control(&self) -> bool

Returns true if only a control modifier key is pressed.

source

fn only_alt(&self) -> bool

Returns true if only an alt modifier key is pressed.

source

fn only_super(&self) -> bool

Returns true if only a super modifier key is pressed.

source

fn word_select(&self) -> bool

Returns true if the platform-specific modifier for word-selection is pressed.

For Apple-based platforms, this returns true if an “alt” key is pressed. This corresponds to the Option key.

For all other platforms, this returns true if a control key is pressed.

source

fn possible_shortcut(&self) -> bool

Returns true if the current modifier state might be a shortcut key.

This returns true if either the control key, alt key, or super key are pressed.

Implementations on Foreign Types§

source§

impl ModifiersExt for Modifiers

source§

impl ModifiersExt for ModifiersState

Implementors§