InitialObjectDescriptor { objectDescriptorID 1 audioProfileLevelIndication 255 visualProfileLevelIndication 254 sceneProfileLevelIndication 1 graphicsProfileLevelIndication 1 ODProfileLevelIndication 1 esDescr [ ES_Descriptor { ES_ID 1 decConfigDescr DecoderConfigDescriptor { streamType 3 decSpecificInfo BIFSConfig { isCommandStream true pixelMetric true pixelWidth 600 pixelHeight 600 } } } ES_Descriptor { ES_ID 2 decConfigDescr DecoderConfigDescriptor { streamType 1 } } ] } OrderedGroup { children [ Background2D { backColor 1 1 1 } WorldInfo { info [ "This test shows usage of the InputSensor node to detect keys and trigger of events" "The InputSensor in this case has a url which points to a specific pseudo-media object. This object contains one stream, called interaction stream." "This stream is made of Device Data Frame whose content is specialized depending on the kind of input device." "The InputSensor node in the scene specifies how to dispatch the content of the DDF." "For each piece of information in the DDF, a REPLACE command is associated." "The value of the target property is replaced by the associated content from the DDF." "" "If the configuration of the stream says 'KeySensor', like here, the input device is a keyboard and the DDF content is as follows:" "- the key code for the pressed key (0 if none)," "- the key code for the released key (0 if none)," "- the key code for the action key (F1, ...) pressed (0 if none)," "- the key code for the action key (F1, ...) released (0 for none)," "- and the state of the modifier keys (CTRL, ALT and Shift)." "In this example, the target nodes are Valuator nodes which cast the key code into the char representation, and the result is displayed." "" "GPAC Regression Tests" "(C) 2002-2006 GPAC Team" ] title "InputSensor Node for detecting keys (KeySensor)" } DEF N33 Switch { choice [ Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 1 1 1 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0.5 0.5 1 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0.5 1 1 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 1 0.5 1 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 1 0 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 0 1 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 1 1 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 1 0 0 filled TRUE } } geometry Rectangle { size 200 200 } } ] } ] } ] } DEF N10 Conditional { buffer { REPLACE N33.whichChoice BY 0 } } Group { children [ DEF N12 TouchSensor {} Transform2D { translation -195 -120 children [ Shape { appearance Appearance { material Material2D { emissiveColor 1 1 1 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance DEF N29 Appearance { material Material2D { emissiveColor 0 0 0 filled TRUE } } geometry Text { string ["F1"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N20 Conditional { buffer { REPLACE N33.whichChoice BY 1 } } Group { children [ DEF N19 TouchSensor {} Transform2D { translation -195 0 children [ Shape { appearance Appearance { material Material2D { emissiveColor 0.5 0.5 1 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F2"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N23 Conditional { buffer { REPLACE N33.whichChoice BY 2 } } Group { children [ DEF N9 TouchSensor {} Transform2D { translation -195 120 children [ Shape { appearance Appearance { material Material2D { emissiveColor 0.5 1 1 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F3"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N14 Conditional { buffer { REPLACE N33.whichChoice BY 3 } } Group { children [ DEF N31 TouchSensor {} Transform2D { translation -195 240 children [ Shape { appearance Appearance { material Material2D { emissiveColor 1 0.5 1 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F4"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N15 Conditional { buffer { REPLACE N33.whichChoice BY 4 } } Group { children [ DEF N25 TouchSensor {} Transform2D { translation 195 -120 children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 1 0 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F5"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N16 Conditional { buffer { REPLACE N33.whichChoice BY 5 } } Group { children [ DEF N11 TouchSensor {} Transform2D { translation 195 0 children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 0 1 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F6"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N17 Conditional { buffer { REPLACE N33.whichChoice BY 6 } } Group { children [ DEF N18 TouchSensor {} Transform2D { translation 195 120 children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 1 1 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F7"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } DEF N27 Conditional { buffer { REPLACE N33.whichChoice BY 7 } } Group { children [ DEF N13 TouchSensor {} Transform2D { translation 195 240 children [ Shape { appearance Appearance { material Material2D { emissiveColor 1 0 0 filled TRUE } } geometry Rectangle { size 100 100 } } Shape { appearance USE N29 geometry Text { string ["F8"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } ] } Transform2D { translation 0 -120 children [ Shape { appearance USE N29 geometry Text { string ["KeySensor"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 30 } } } ] } Transform2D { translation -50 -150 children [ Shape { appearance USE N29 geometry Text { string ["KeyPress"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -150 children [ Shape { appearance USE N29 geometry DEF N32 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation -50 -170 children [ Shape { appearance USE N29 geometry Text { string ["KeyRelease"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -170 children [ Shape { appearance USE N29 geometry DEF N30 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation -50 -190 children [ Shape { appearance USE N29 geometry Text { string ["ActionKeyPress"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -190 children [ Shape { appearance USE N29 geometry DEF N28 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation -50 -210 children [ Shape { appearance USE N29 geometry Text { string ["ActionKeyRelease"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -210 children [ Shape { appearance USE N29 geometry DEF N26 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation -50 -230 children [ Shape { appearance USE N29 geometry Text { string ["shiftKey_changed"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -230 children [ Shape { appearance USE N29 geometry DEF N24 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation -50 -250 children [ Shape { appearance USE N29 geometry Text { string ["controlKey_changed"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -250 children [ Shape { appearance USE N29 geometry DEF N22 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation -50 -270 children [ Shape { appearance USE N29 geometry Text { string ["altKey_changed"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } Transform2D { translation 90 -270 children [ Shape { appearance USE N29 geometry DEF N21 Text { string ["0"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 20 } } } ] } DEF N3 Valuator {} DEF N7 Valuator { Offset1 -1 } DEF N6 Valuator {} DEF N5 Valuator {} DEF N4 Valuator {} DEF N2 Valuator {} DEF N1 Valuator {} DEF N0 Valuator {} InputSensor { url [od:10] buffer { REPLACE N6.inSFInt32 BY 0 REPLACE N5.inSFInt32 BY 0 REPLACE N3.inSFInt32 BY 0 REPLACE N4.inSFInt32 BY 0 REPLACE N2.inSFBool BY TRUE REPLACE N1.inSFBool BY TRUE REPLACE N0.inSFBool BY TRUE } } Group { children [ Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 0 0 } } geometry Rectangle { size 200 200 } } ] } ] } ] } ROUTE N6.outMFString TO N32.string ROUTE N5.outMFString TO N30.string ROUTE N4.outMFString TO N26.string ROUTE N2.outMFString TO N24.string ROUTE N1.outMFString TO N22.string ROUTE N0.outMFString TO N21.string ROUTE N3.outSFInt32 TO N7.inSFInt32 ROUTE N3.outMFString TO N28.string ROUTE N7.outSFInt32 TO N33.whichChoice ROUTE N12.isActive TO N10.activate ROUTE N19.isActive TO N20.activate ROUTE N9.isActive TO N23.activate ROUTE N31.isActive TO N14.activate ROUTE N25.isActive TO N15.activate ROUTE N11.isActive TO N16.activate ROUTE N18.isActive TO N17.activate ROUTE N13.isActive TO N27.activate AT 0 { UPDATE OD [ ObjectDescriptor { objectDescriptorID 10 esDescr [ ES_Descriptor { ES_ID 5 decConfigDescr DecoderConfigDescriptor { streamType 10 decSpecificInfo UIConfig { deviceName "KeySensor" } } } ] } ] }