1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = KeyboardEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `KeyboardEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
12 pub type KeyboardEventInit;
13 #[doc = "Get the `bubbles` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
16 #[wasm_bindgen(method, getter = "bubbles")]
17 pub fn get_bubbles(this: &KeyboardEventInit) -> Option<bool>;
18 #[doc = "Change the `bubbles` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
21 #[wasm_bindgen(method, setter = "bubbles")]
22 pub fn set_bubbles(this: &KeyboardEventInit, val: bool);
23 #[doc = "Get the `cancelable` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
26 #[wasm_bindgen(method, getter = "cancelable")]
27 pub fn get_cancelable(this: &KeyboardEventInit) -> Option<bool>;
28 #[doc = "Change the `cancelable` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
31 #[wasm_bindgen(method, setter = "cancelable")]
32 pub fn set_cancelable(this: &KeyboardEventInit, val: bool);
33 #[doc = "Get the `composed` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
36 #[wasm_bindgen(method, getter = "composed")]
37 pub fn get_composed(this: &KeyboardEventInit) -> Option<bool>;
38 #[doc = "Change the `composed` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
41 #[wasm_bindgen(method, setter = "composed")]
42 pub fn set_composed(this: &KeyboardEventInit, val: bool);
43 #[doc = "Get the `detail` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
46 #[wasm_bindgen(method, getter = "detail")]
47 pub fn get_detail(this: &KeyboardEventInit) -> Option<i32>;
48 #[doc = "Change the `detail` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
51 #[wasm_bindgen(method, setter = "detail")]
52 pub fn set_detail(this: &KeyboardEventInit, val: i32);
53 #[cfg(feature = "Window")]
54 #[doc = "Get the `view` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`, `Window`*"]
57 #[wasm_bindgen(method, getter = "view")]
58 pub fn get_view(this: &KeyboardEventInit) -> Option<Window>;
59 #[cfg(feature = "Window")]
60 #[doc = "Change the `view` field of this object."]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`, `Window`*"]
63 #[wasm_bindgen(method, setter = "view")]
64 pub fn set_view(this: &KeyboardEventInit, val: Option<&Window>);
65 #[doc = "Get the `altKey` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
68 #[wasm_bindgen(method, getter = "altKey")]
69 pub fn get_alt_key(this: &KeyboardEventInit) -> Option<bool>;
70 #[doc = "Change the `altKey` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
73 #[wasm_bindgen(method, setter = "altKey")]
74 pub fn set_alt_key(this: &KeyboardEventInit, val: bool);
75 #[doc = "Get the `ctrlKey` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
78 #[wasm_bindgen(method, getter = "ctrlKey")]
79 pub fn get_ctrl_key(this: &KeyboardEventInit) -> Option<bool>;
80 #[doc = "Change the `ctrlKey` field of this object."]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
83 #[wasm_bindgen(method, setter = "ctrlKey")]
84 pub fn set_ctrl_key(this: &KeyboardEventInit, val: bool);
85 #[doc = "Get the `metaKey` field of this object."]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
88 #[wasm_bindgen(method, getter = "metaKey")]
89 pub fn get_meta_key(this: &KeyboardEventInit) -> Option<bool>;
90 #[doc = "Change the `metaKey` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
93 #[wasm_bindgen(method, setter = "metaKey")]
94 pub fn set_meta_key(this: &KeyboardEventInit, val: bool);
95 #[doc = "Get the `modifierAltGraph` field of this object."]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
98 #[wasm_bindgen(method, getter = "modifierAltGraph")]
99 pub fn get_modifier_alt_graph(this: &KeyboardEventInit) -> Option<bool>;
100 #[doc = "Change the `modifierAltGraph` field of this object."]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
103 #[wasm_bindgen(method, setter = "modifierAltGraph")]
104 pub fn set_modifier_alt_graph(this: &KeyboardEventInit, val: bool);
105 #[doc = "Get the `modifierCapsLock` field of this object."]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
108 #[wasm_bindgen(method, getter = "modifierCapsLock")]
109 pub fn get_modifier_caps_lock(this: &KeyboardEventInit) -> Option<bool>;
110 #[doc = "Change the `modifierCapsLock` field of this object."]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
113 #[wasm_bindgen(method, setter = "modifierCapsLock")]
114 pub fn set_modifier_caps_lock(this: &KeyboardEventInit, val: bool);
115 #[doc = "Get the `modifierFn` field of this object."]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
118 #[wasm_bindgen(method, getter = "modifierFn")]
119 pub fn get_modifier_fn(this: &KeyboardEventInit) -> Option<bool>;
120 #[doc = "Change the `modifierFn` field of this object."]
121 #[doc = ""]
122 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
123 #[wasm_bindgen(method, setter = "modifierFn")]
124 pub fn set_modifier_fn(this: &KeyboardEventInit, val: bool);
125 #[doc = "Get the `modifierFnLock` field of this object."]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
128 #[wasm_bindgen(method, getter = "modifierFnLock")]
129 pub fn get_modifier_fn_lock(this: &KeyboardEventInit) -> Option<bool>;
130 #[doc = "Change the `modifierFnLock` field of this object."]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
133 #[wasm_bindgen(method, setter = "modifierFnLock")]
134 pub fn set_modifier_fn_lock(this: &KeyboardEventInit, val: bool);
135 #[doc = "Get the `modifierNumLock` field of this object."]
136 #[doc = ""]
137 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
138 #[wasm_bindgen(method, getter = "modifierNumLock")]
139 pub fn get_modifier_num_lock(this: &KeyboardEventInit) -> Option<bool>;
140 #[doc = "Change the `modifierNumLock` field of this object."]
141 #[doc = ""]
142 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
143 #[wasm_bindgen(method, setter = "modifierNumLock")]
144 pub fn set_modifier_num_lock(this: &KeyboardEventInit, val: bool);
145 #[doc = "Get the `modifierOS` field of this object."]
146 #[doc = ""]
147 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
148 #[wasm_bindgen(method, getter = "modifierOS")]
149 pub fn get_modifier_os(this: &KeyboardEventInit) -> Option<bool>;
150 #[doc = "Change the `modifierOS` field of this object."]
151 #[doc = ""]
152 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
153 #[wasm_bindgen(method, setter = "modifierOS")]
154 pub fn set_modifier_os(this: &KeyboardEventInit, val: bool);
155 #[doc = "Get the `modifierScrollLock` field of this object."]
156 #[doc = ""]
157 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
158 #[wasm_bindgen(method, getter = "modifierScrollLock")]
159 pub fn get_modifier_scroll_lock(this: &KeyboardEventInit) -> Option<bool>;
160 #[doc = "Change the `modifierScrollLock` field of this object."]
161 #[doc = ""]
162 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
163 #[wasm_bindgen(method, setter = "modifierScrollLock")]
164 pub fn set_modifier_scroll_lock(this: &KeyboardEventInit, val: bool);
165 #[doc = "Get the `modifierSymbol` field of this object."]
166 #[doc = ""]
167 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
168 #[wasm_bindgen(method, getter = "modifierSymbol")]
169 pub fn get_modifier_symbol(this: &KeyboardEventInit) -> Option<bool>;
170 #[doc = "Change the `modifierSymbol` field of this object."]
171 #[doc = ""]
172 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
173 #[wasm_bindgen(method, setter = "modifierSymbol")]
174 pub fn set_modifier_symbol(this: &KeyboardEventInit, val: bool);
175 #[doc = "Get the `modifierSymbolLock` field of this object."]
176 #[doc = ""]
177 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
178 #[wasm_bindgen(method, getter = "modifierSymbolLock")]
179 pub fn get_modifier_symbol_lock(this: &KeyboardEventInit) -> Option<bool>;
180 #[doc = "Change the `modifierSymbolLock` field of this object."]
181 #[doc = ""]
182 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
183 #[wasm_bindgen(method, setter = "modifierSymbolLock")]
184 pub fn set_modifier_symbol_lock(this: &KeyboardEventInit, val: bool);
185 #[doc = "Get the `shiftKey` field of this object."]
186 #[doc = ""]
187 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
188 #[wasm_bindgen(method, getter = "shiftKey")]
189 pub fn get_shift_key(this: &KeyboardEventInit) -> Option<bool>;
190 #[doc = "Change the `shiftKey` field of this object."]
191 #[doc = ""]
192 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
193 #[wasm_bindgen(method, setter = "shiftKey")]
194 pub fn set_shift_key(this: &KeyboardEventInit, val: bool);
195 #[doc = "Get the `charCode` field of this object."]
196 #[doc = ""]
197 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
198 #[wasm_bindgen(method, getter = "charCode")]
199 pub fn get_char_code(this: &KeyboardEventInit) -> Option<u32>;
200 #[doc = "Change the `charCode` field of this object."]
201 #[doc = ""]
202 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
203 #[wasm_bindgen(method, setter = "charCode")]
204 pub fn set_char_code(this: &KeyboardEventInit, val: u32);
205 #[doc = "Get the `code` field of this object."]
206 #[doc = ""]
207 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
208 #[wasm_bindgen(method, getter = "code")]
209 pub fn get_code(this: &KeyboardEventInit) -> Option<::alloc::string::String>;
210 #[doc = "Change the `code` field of this object."]
211 #[doc = ""]
212 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
213 #[wasm_bindgen(method, setter = "code")]
214 pub fn set_code(this: &KeyboardEventInit, val: &str);
215 #[doc = "Get the `isComposing` field of this object."]
216 #[doc = ""]
217 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
218 #[wasm_bindgen(method, getter = "isComposing")]
219 pub fn get_is_composing(this: &KeyboardEventInit) -> Option<bool>;
220 #[doc = "Change the `isComposing` field of this object."]
221 #[doc = ""]
222 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
223 #[wasm_bindgen(method, setter = "isComposing")]
224 pub fn set_is_composing(this: &KeyboardEventInit, val: bool);
225 #[doc = "Get the `key` field of this object."]
226 #[doc = ""]
227 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
228 #[wasm_bindgen(method, getter = "key")]
229 pub fn get_key(this: &KeyboardEventInit) -> Option<::alloc::string::String>;
230 #[doc = "Change the `key` field of this object."]
231 #[doc = ""]
232 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
233 #[wasm_bindgen(method, setter = "key")]
234 pub fn set_key(this: &KeyboardEventInit, val: &str);
235 #[doc = "Get the `keyCode` field of this object."]
236 #[doc = ""]
237 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
238 #[wasm_bindgen(method, getter = "keyCode")]
239 pub fn get_key_code(this: &KeyboardEventInit) -> Option<u32>;
240 #[doc = "Change the `keyCode` field of this object."]
241 #[doc = ""]
242 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
243 #[wasm_bindgen(method, setter = "keyCode")]
244 pub fn set_key_code(this: &KeyboardEventInit, val: u32);
245 #[doc = "Get the `location` field of this object."]
246 #[doc = ""]
247 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
248 #[wasm_bindgen(method, getter = "location")]
249 pub fn get_location(this: &KeyboardEventInit) -> Option<u32>;
250 #[doc = "Change the `location` field of this object."]
251 #[doc = ""]
252 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
253 #[wasm_bindgen(method, setter = "location")]
254 pub fn set_location(this: &KeyboardEventInit, val: u32);
255 #[doc = "Get the `repeat` field of this object."]
256 #[doc = ""]
257 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
258 #[wasm_bindgen(method, getter = "repeat")]
259 pub fn get_repeat(this: &KeyboardEventInit) -> Option<bool>;
260 #[doc = "Change the `repeat` field of this object."]
261 #[doc = ""]
262 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
263 #[wasm_bindgen(method, setter = "repeat")]
264 pub fn set_repeat(this: &KeyboardEventInit, val: bool);
265 #[doc = "Get the `which` field of this object."]
266 #[doc = ""]
267 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
268 #[wasm_bindgen(method, getter = "which")]
269 pub fn get_which(this: &KeyboardEventInit) -> Option<u32>;
270 #[doc = "Change the `which` field of this object."]
271 #[doc = ""]
272 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
273 #[wasm_bindgen(method, setter = "which")]
274 pub fn set_which(this: &KeyboardEventInit, val: u32);
275}
276impl KeyboardEventInit {
277 #[doc = "Construct a new `KeyboardEventInit`."]
278 #[doc = ""]
279 #[doc = "*This API requires the following crate features to be activated: `KeyboardEventInit`*"]
280 pub fn new() -> Self {
281 #[allow(unused_mut)]
282 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
283 ret
284 }
285 #[deprecated = "Use `set_bubbles()` instead."]
286 pub fn bubbles(&mut self, val: bool) -> &mut Self {
287 self.set_bubbles(val);
288 self
289 }
290 #[deprecated = "Use `set_cancelable()` instead."]
291 pub fn cancelable(&mut self, val: bool) -> &mut Self {
292 self.set_cancelable(val);
293 self
294 }
295 #[deprecated = "Use `set_composed()` instead."]
296 pub fn composed(&mut self, val: bool) -> &mut Self {
297 self.set_composed(val);
298 self
299 }
300 #[deprecated = "Use `set_detail()` instead."]
301 pub fn detail(&mut self, val: i32) -> &mut Self {
302 self.set_detail(val);
303 self
304 }
305 #[cfg(feature = "Window")]
306 #[deprecated = "Use `set_view()` instead."]
307 pub fn view(&mut self, val: Option<&Window>) -> &mut Self {
308 self.set_view(val);
309 self
310 }
311 #[deprecated = "Use `set_alt_key()` instead."]
312 pub fn alt_key(&mut self, val: bool) -> &mut Self {
313 self.set_alt_key(val);
314 self
315 }
316 #[deprecated = "Use `set_ctrl_key()` instead."]
317 pub fn ctrl_key(&mut self, val: bool) -> &mut Self {
318 self.set_ctrl_key(val);
319 self
320 }
321 #[deprecated = "Use `set_meta_key()` instead."]
322 pub fn meta_key(&mut self, val: bool) -> &mut Self {
323 self.set_meta_key(val);
324 self
325 }
326 #[deprecated = "Use `set_modifier_alt_graph()` instead."]
327 pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self {
328 self.set_modifier_alt_graph(val);
329 self
330 }
331 #[deprecated = "Use `set_modifier_caps_lock()` instead."]
332 pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self {
333 self.set_modifier_caps_lock(val);
334 self
335 }
336 #[deprecated = "Use `set_modifier_fn()` instead."]
337 pub fn modifier_fn(&mut self, val: bool) -> &mut Self {
338 self.set_modifier_fn(val);
339 self
340 }
341 #[deprecated = "Use `set_modifier_fn_lock()` instead."]
342 pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self {
343 self.set_modifier_fn_lock(val);
344 self
345 }
346 #[deprecated = "Use `set_modifier_num_lock()` instead."]
347 pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self {
348 self.set_modifier_num_lock(val);
349 self
350 }
351 #[deprecated = "Use `set_modifier_os()` instead."]
352 pub fn modifier_os(&mut self, val: bool) -> &mut Self {
353 self.set_modifier_os(val);
354 self
355 }
356 #[deprecated = "Use `set_modifier_scroll_lock()` instead."]
357 pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self {
358 self.set_modifier_scroll_lock(val);
359 self
360 }
361 #[deprecated = "Use `set_modifier_symbol()` instead."]
362 pub fn modifier_symbol(&mut self, val: bool) -> &mut Self {
363 self.set_modifier_symbol(val);
364 self
365 }
366 #[deprecated = "Use `set_modifier_symbol_lock()` instead."]
367 pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self {
368 self.set_modifier_symbol_lock(val);
369 self
370 }
371 #[deprecated = "Use `set_shift_key()` instead."]
372 pub fn shift_key(&mut self, val: bool) -> &mut Self {
373 self.set_shift_key(val);
374 self
375 }
376 #[deprecated = "Use `set_char_code()` instead."]
377 pub fn char_code(&mut self, val: u32) -> &mut Self {
378 self.set_char_code(val);
379 self
380 }
381 #[deprecated = "Use `set_code()` instead."]
382 pub fn code(&mut self, val: &str) -> &mut Self {
383 self.set_code(val);
384 self
385 }
386 #[deprecated = "Use `set_is_composing()` instead."]
387 pub fn is_composing(&mut self, val: bool) -> &mut Self {
388 self.set_is_composing(val);
389 self
390 }
391 #[deprecated = "Use `set_key()` instead."]
392 pub fn key(&mut self, val: &str) -> &mut Self {
393 self.set_key(val);
394 self
395 }
396 #[deprecated = "Use `set_key_code()` instead."]
397 pub fn key_code(&mut self, val: u32) -> &mut Self {
398 self.set_key_code(val);
399 self
400 }
401 #[deprecated = "Use `set_location()` instead."]
402 pub fn location(&mut self, val: u32) -> &mut Self {
403 self.set_location(val);
404 self
405 }
406 #[deprecated = "Use `set_repeat()` instead."]
407 pub fn repeat(&mut self, val: bool) -> &mut Self {
408 self.set_repeat(val);
409 self
410 }
411 #[deprecated = "Use `set_which()` instead."]
412 pub fn which(&mut self, val: u32) -> &mut Self {
413 self.set_which(val);
414 self
415 }
416}
417impl Default for KeyboardEventInit {
418 fn default() -> Self {
419 Self::new()
420 }
421}