1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! Touch service, properties, events and other types.
//!
//! The example below defines a window that shows the active touches and prints the touch state changes. The
//! touch's text follows the first touch position.
//!
//! ```
//! use zng::prelude::*;
//! # let _scope = APP.defaults();
//!
//! # let _ =
//! Window! {
//! child_align = layout::Align::TOP_LEFT;
//! child = Text! {
//! txt = touch::TOUCH.positions().map(|p| {
//! let mut t = Txt::from("[\n");
//! for p in p {
//! use std::fmt::Write as _;
//! writeln!(&mut t, " ({:?}, {:?})", p.touch, p.position).unwrap();
//! }
//! t.push(']');
//! t.end_mut();
//! t
//! });
//! font_size = 1.4.em();
//! layout::offset = touch::TOUCH.positions().map(|p| match p.first() {
//! Some(p) => layout::Vector::from(p.position.to_vector()) - layout::Vector::new(0, 100.pct()),
//! None => layout::Vector::zero(),
//! });
//! };
//! touch::on_touch_input = hn!(|args: &touch::TouchInputArgs| {
//! println!("touch {:?} {:?}", args.touch, args.phase);
//! });
//! }
//! # ;
//! ```
//!
//! Touch events are send to the top widget under the touch point. This module also provides touch exclusive gestures like
//! tap, touch enter/leave and [`on_touch_transform`]. Note some touch gestures are composed with others in [`gesture`] to provide the
//! final pointer gestures. You should prefer using [`gesture::on_click`] over [`on_touch_tap`], unless you really want to exclusively
//! touch clicks.
//!
//! [`on_touch_tap`]: fn@on_touch_tap
//! [`on_touch_transform`]: fn@on_touch_transform
//! [`gesture`]: crate::gesture
//! [`gesture::on_click`]: fn@crate::gesture::on_click
//! [`on_mouse_click`]: fn@on_mouse_click
//!
//! # Full API
//!
//! See [`zng_ext_input::touch`] and [`zng_wgt_input::touch`] for the full touch API.
pub use ;
pub use ;
pub use ;