This repository was archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathglobal-key-events.ftd
More file actions
83 lines (48 loc) · 1.54 KB
/
global-key-events.ftd
File metadata and controls
83 lines (48 loc) · 1.54 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
-- string $name: Foo
-- my-ds.page: Global Key Event Handling
There are two different global events in `ftd`
`$on-global-key[<keys sequence>]$` and `$on-global-key-seq[<keys sequence>]$`.
-- ds.h1: `$on-global-key[<keys sequence>]$: <event action>`
In this case user has to press keys simultaneously with same sequence, and
`event action` will get triggered.
-- ds.h1: `$on-global-key-seq[<keys sequence>]$: <event action>`
In this case user has to press keys in same sequence, and `event action` will
get triggered.
-- ds.h1: Special Keys Map
`ftd` to Keyboard Mapping
"ctrl" => "Control",
"alt" => "Alt",
"shift" => "Shift",
"up" => "ArrowUp",
"down" => "ArrowDown",
"right" => "ArrowRight",
"left" => "ArrowLeft",
"esc" => "Escape",
"dash" => "-",
"space" => " ",
-- ds.code:
lang: ftd
\-- string $name: Foo
\-- ftd.text: $name
color: $inherited.colors.text-strong
$on-global-key[ctrl-j]$: $set($a = $name, v = Arpita)
$on-global-key[ctrl-3]$: $set($a = $name, v = Ayushi)
$on-global-key-seq[shift-shift]$: $set($a = $name, v = Rajshri)
$on-global-key-seq[space-dash]$: $set($a = $name, v = Jatinderjit)
\-- void set(a,v):
string $a:
string v:
a = v
-- ds.output:
-- ftd.text: $name
color: $inherited.colors.text-strong
$on-global-key[ctrl-j]$: $set($a = $name, v = Arpita)
$on-global-key[ctrl-3]$: $set($a = $name, v = Ayushi)
$on-global-key-seq[shift-shift]$: $set($a = $name, v = Rajshri)
$on-global-key-seq[space-dash]$: $set($a = $name, v = Jatinderjit)
-- end: ds.output
-- end: my-ds.page
-- void set(a,v):
string $a:
string v:
a = v