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
//! `KeyboardEvent.code`, narrowed to the keys the ported controls read.
/// A DOM `KeyboardEvent.code`, as a value: the physical keys
/// [`FirstPersonControls`](super::FirstPersonControls) and
/// [`FlyControls`](super::FlyControls) bind. Both JS classes switch on
/// `event.code`, which names a key by its position on a US layout, so `KeyW`
/// is the key left of `KeyE` on an AZERTY keyboard too; a host that maps its
/// own key events onto these should map physical keys (winit's `PhysicalKey`),
/// not the characters they type.
///
/// Every other code is [`KeyCode::Other`], which both classes ignore, as their
/// `switch` statements do.
///
/// Non-exhaustive: a later port that binds another key adds a variant.