/
KeyboardLayoutMap.cljs
151 lines (106 loc) · 4.14 KB
/
KeyboardLayoutMap.cljs
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
(ns web.keyboard.KeyboardLayoutMap
"The KeyboardLayoutMap interface of the the Keyboard API is a
object with functions for retrieving the string associated with
physical keys."
(:refer-clojure :exclude [keys get]))
(defn for-each
"Method.
The forEach() method of the `web.keyboard.KeyboardLayoutMap`
executes a provided function once for each element of the map.
`KeyboardLayoutMap.forEach(function callback(currentValue[, index[, array]]) {
//your iterator
}[, thisArg]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/forEach`"
[this & args]
(apply (-> this .-forEach) (concat [this] args)))
(defn get
"Method.
The get() method of the `web.keyboard.KeyboardLayoutMap` interface
the element with the given key.
`var value = KeyboardLayoutMap.get(key)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/get`"
[this key]
(-> this (.get key)))
(defn has
"Method.
The has() method of the `web.keyboard.KeyboardLayoutMap` interface
a boolean indicating whether the object has an element with the
key.
`var aBoolean = KeyboardLayoutMap.has(key)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/has`"
[this key]
(-> this (.has key)))
(defn entries
"Property.
The entries read-only property of the `web.keyboard.KeyboardLayoutMap`
returns an array of a given object's own enumerable property
value] pairs, in the same order as that provided by a `for...in`
(the difference being that a for-in loop enumerates properties
the prototype chain as well).
`KeyboardLayoutMap.entries()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/entries`"
[this]
(-> this (.entries)))
(defn set-entries!
"Property.
The entries read-only property of the `web.keyboard.KeyboardLayoutMap`
returns an array of a given object's own enumerable property
value] pairs, in the same order as that provided by a `for...in`
(the difference being that a for-in loop enumerates properties
the prototype chain as well).
`KeyboardLayoutMap.entries()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/entries`"
[this val]
(aset this "entries" val))
(defn keys
"Property.
The keys read-only property of the `web.keyboard.KeyboardLayoutMap`
returns a new object that contains the keys for each index in
array.
`iterator = KeyboardLayoutMap.keys`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/keys`"
[this]
(-> this (.keys)))
(defn set-keys!
"Property.
The keys read-only property of the `web.keyboard.KeyboardLayoutMap`
returns a new object that contains the keys for each index in
array.
`iterator = KeyboardLayoutMap.keys`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/keys`"
[this val]
(aset this "keys" val))
(defn size
"Property.
The size read-only property of the `web.keyboard.KeyboardLayoutMap`
returns the number of elements in the map.
`var size = KeyboardLayoutMap.size()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/size`"
[this]
(-> this (.size)))
(defn set-size!
"Property.
The size read-only property of the `web.keyboard.KeyboardLayoutMap`
returns the number of elements in the map.
`var size = KeyboardLayoutMap.size()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/size`"
[this val]
(aset this "size" val))
(defn values
"Property.
The values read-only property of the `web.keyboard.KeyboardLayoutMap`
returns a new object that contains the values for each index
the .
`var iterator = KeyboardLayoutMap.values`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/values`"
[this]
(-> this (.values)))
(defn set-values!
"Property.
The values read-only property of the `web.keyboard.KeyboardLayoutMap`
returns a new object that contains the values for each index
the .
`var iterator = KeyboardLayoutMap.values`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap/values`"
[this val]
(aset this "values" val))