forked from jimrandomh/faceclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgestures.ts
More file actions
24 lines (23 loc) · 873 Bytes
/
Copy pathgestures.ts
File metadata and controls
24 lines (23 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* Compact glyphs for the ring gestures, used in on-glasses hint text instead
* of spelling the gesture out. All codepoints exist in terminus12/16.
*
* click · (U+00B7 middle dot)
* double-click ·· (twice)
* scroll ▲▼ (U+25B2 / U+25BC)
* long-press - (hyphen-minus)
*/
export const GESTURE_CLICK = "·";
export const GESTURE_DOUBLE_CLICK = "··";
export const GESTURE_SCROLL_UP = "▲";
export const GESTURE_SCROLL_DOWN = "▼";
export const GESTURE_SCROLL = "▲▼";
export const GESTURE_LONG_PRESS = "-";
/**
* Join "glyph action" hint pairs into a single line, e.g.
* gestureHints([[GESTURE_CLICK, "save"], [GESTURE_DOUBLE_CLICK, "back"]])
* => "· save ·· back"
*/
export function gestureHints(pairs: Array<[string, string]>): string {
return pairs.map(([glyph, action]) => `${glyph} ${action}`).join(" ");
}