Debian Codegraph @

tests/data/key_sensor_2.x3dv

raw
1 #X3D V3.2 utf8
2 PROFILE Interchange
3
4 NavigationInfo {
5 type ["EXAMINE", "WALK", "ANY"]
6 headlight FALSE
7 }
8
9 PROTO SimpleText [
10 inputOutput MFString string ""
11 inputOutput SFColor color 1 1 1
12 ] {
13 Shape {
14 appearance Appearance { material Material { diffuseColor IS color } }
15 geometry Text { string IS string }
16 }
17 }
18
19 PROTO PressedText [
20 inputOutput MFString string ""
21 ] {
22 SimpleText {
23 string IS string
24 color 1 1 0
25 }
26 }
27
28 PROTO ReleasedText [
29 inputOutput MFString string ""
30 ] {
31 SimpleText {
32 string IS string
33 color 0.4 0.4 1
34 }
35 }
36
37 Transform {
38 translation 0 +1.2 0
39 children [
40 Transform {
41 translation 0 1 0
42 children PressedText { string "Pressed:" }
43 }
44
45 DEF SPressed Switch {
46 children [
47 PressedText { string "zero" }
48 PressedText { string "F1" }
49 PressedText { string "F2" }
50 PressedText { string "F3" }
51 PressedText { string "F4" }
52 PressedText { string "F5" }
53 PressedText { string "F6" }
54 PressedText { string "F7" }
55 PressedText { string "F8" }
56 PressedText { string "F9" }
57 PressedText { string "F10" }
58 PressedText { string "F11" }
59 PressedText { string "F12" }
60 PressedText { string "Home" }
61 PressedText { string "End" }
62 PressedText { string "PgUp" }
63 PressedText { string "PgDown" }
64 PressedText { string "Up" }
65 PressedText { string "Down" }
66 PressedText { string "Left" }
67 PressedText { string "Right" }
68 ]
69 }
70
71 DirectionalLight { }
72 ]
73 }
74
75 Transform {
76 translation 0 -1.2 0
77 children [
78 Transform {
79 translation 0 1 0
80 children ReleasedText { string "Released:" }
81 }
82
83 DEF SReleased Switch {
84 whichChoice 30
85 children [
86 ReleasedText { string "zero" }
87 ReleasedText { string "F1" }
88 ReleasedText { string "F2" }
89 ReleasedText { string "F3" }
90 ReleasedText { string "F4" }
91 ReleasedText { string "F5" }
92 ReleasedText { string "F6" }
93 ReleasedText { string "F7" }
94 ReleasedText { string "F8" }
95 ReleasedText { string "F9" }
96 ReleasedText { string "F10" }
97 ReleasedText { string "F11" }
98 ReleasedText { string "F12" }
99 ReleasedText { string "Home" }
100 ReleasedText { string "End" }
101 ReleasedText { string "PgUp" }
102 ReleasedText { string "PgDown" }
103 ReleasedText { string "Up" }
104 ReleasedText { string "Down" }
105 ReleasedText { string "Left" }
106 ReleasedText { string "Right" }
107 ]
108 }
109
110 DirectionalLight { }
111 ]
112 }
113
114 Transform {
115 translation 0 -2 0
116 children [
117 Shape {
118 appearance Appearance { material Material { diffuseColor 1 0 0 } }
119 geometry Text { string "alt" }
120 }
121 DEF LightAlt DirectionalLight { on FALSE }
122 ]
123 }
124
125 Transform {
126 translation 0 -3 0
127 children [
128 Shape {
129 appearance Appearance { material Material { diffuseColor 0 1 0 } }
130 geometry Text { string "control" }
131 }
132 DEF LightControl DirectionalLight { on FALSE }
133 ]
134 }
135
136 Transform {
137 translation 0 -4 0
138 children [
139 Shape {
140 appearance Appearance { material Material { diffuseColor 0 0 1 } }
141 geometry Text { string "shift" }
142 }
143 DEF LightShift DirectionalLight { on FALSE }
144 ]
145 }
146 DEF K KeySensor { }
147
148 ROUTE K.actionKeyPress TO SPressed.whichChoice
149 ROUTE K.actionKeyRelease TO SReleased.whichChoice
150 ROUTE K.altKey TO LightAlt.on
151 ROUTE K.controlKey TO LightControl.on
152 ROUTE K.shiftKey TO LightShift.on
153