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
//! Keeps mouse buttons and held keys down across calls in one process.
//!
//! `serve` holds one [`InputSession`] for the whole stdin loop, so a
//! `mouse_down` in one request stays down until a later `mouse_up` or until
//! serve exits. A one-shot command does not open a session: `dispatch`
//! releases anything still held when it returns. A batch opens a nested
//! session so its steps share the hold. The release runs when the last
//! session on this thread drops.
use Cell;
use crateDesktopBackend;
thread_local!
/// True while at least one [`InputSession`] is alive on this thread.
/// Guard that releases held buttons and keys when the last one drops.