Expand description
Gesture service, properties, events, shortcuts and other types.
A gesture is an event that is generated from multiple lower-level events. A shortcut is a gesture generated
from one or more keyboard inputs, a click is also a gesture generated from mouse clicks, accessibility clicks,
touch taps and some shortcuts. In essence, events, types and states that aggregate multiple difference sources
are found here, gestures generated from a single event source are defined in other modules, for example touch gestures
are defined in touch
.
use zng::prelude::*;
Window! {
gesture::on_click = hn!(|args: &gesture::ClickArgs| {
use gesture::ClickArgsSource::*;
match args.source {
Mouse { .. } => println!("mouse click"),
Touch { .. } => println!("touch tap"),
Shortcut { .. } => println!("shortcut press"),
Access { .. } => println!("access click"),
}
});
}
The example above handles the click gesture on a window and prints what underlying event was interpreted as a click.
§Full API
See zng_ext_input::gesture
and zng_wgt_input::gesture
for the full gesture API
and zng_app::shortcut
for the shortcut API.
Macros§
- Creates a
Shortcut
.
Structs§
CLICK_EVENT
arguments.- Gesture events config service.
- A sequence of two keyboard combinations.
- A keyboard combination.
- Represents the resolved targets for a shortcut at a time.
SHORTCUT_EVENT
arguments.- Conditions that must be met for the shortcut to apply.
- Multiple shortcuts.
- Represents shortcuts claim in
click_shortcut
orfocus_shortcut
. - Weak
ShortcutsHandle
.
Enums§
- Specific information from the source of a
ClickArgs
. - A keyboard key used in a gesture.
- A modifier key press and release without any other key press in between.
- Keyboard gesture or chord associated with a command.
- What kind of click a shortcut represents in a
ClickArgsSource::Shortcut
.
Statics§
- Aggregate click event.
- Shortcut input event.
Traits§
- Adds the
shortcut
metadata. - Adds the
shortcut_matches
method to commands. - Extension trait that adds gesture simulation methods to
HeadlessApp
.
Functions§
P
Keyboard shortcuts that focus and clicks this widget.P
Keyboard shortcuts that focus and context clicks this widget.P
If the mouse pointer is over the widget, or a descendant, or is captured by the it.P
If the mouse pointer is over the widget or a descendant and the widget is enabled.P
If the mouse pointer is over the widget or a descendant and the widget is disabled.P
On widget click from any source and of any click count and the widget is enabled.P
On widget double click from any source and the widget is enabled.P
On widget click from any source but excluding double/triple clicks and the widget is enabled.P
On widget triple click from any source and the widget is enabled.P
On widget click with the primary button and any click count and the widget is enabled.P
On widget click with the secondary/context button and the widget is enabled.P
On widget click from any source and of any click count and the widget is disabled.P
On widget double click with the primary button and the widget is enabled.P
Previewon_any_click
event.P
Previewon_any_double_click
event.P
Previewon_any_single_click
event.P
Previewon_any_triple_click
event.P
Previewon_click
event.P
Previewon_context_click
event.P
Previewon_disabled_click
event.P
Previewon_double_click
event.P
Previewon_single_click
event.P
Previewon_triple_click
event.P
On widget click with the primary button, excluding double/triple clicks and the widget is enabled.P
On widget triple click with the primary button and the widget is enabled.