InitialObjectDescriptor {
 objectDescriptorID 1
 ODProfileLevelIndication 1
 esDescr [
  ES_Descriptor {
   ES_ID 1
   decConfigDescr DecoderConfigDescriptor {
    objectTypeIndication 1
    streamType 3
    bufferSizeDB 177
    decSpecificInfo BIFSConfig {
     nodeIDbits 24
     isCommandStream true
     pixelMetric true
     pixelWidth 400
     pixelHeight 300
    }
   }
  }
 ]
}

OrderedGroup {
 children [
  Background2D {backColor 1 1 1}
  WorldInfo {
   info [
    "This test shows usage of the KeyNavigator node. Navigate through the keypad between the various items."
    "" 
    "GPAC Regression Tests" "$Date: $ - $Revision: $" 
    "(C) 2010-200X GPAC Team"
   ]
   title "KeyNavigator Node for testing keypad navigation"
  }
  Transform2D {
   translation -100 100
   children [
    Shape {
     appearance Appearance {
      material DEF M1 Material2D {
       emissiveColor 1 0 0
      }
     }
     geometry Rectangle {
      size 60 60
     }
    }
    DEF TS1 TouchSensor {}
    DEF V1 Valuator { Factor1 0.75 }
   ]
  }

  Transform2D {
   translation 100 100
   children [
    Shape {
     appearance Appearance {
      material DEF M2 Material2D {
       emissiveColor 0 1 0
      }
     }
     geometry Rectangle {
      size 60 60
     }
    }
    DEF TS2 TouchSensor {}
    DEF V2 Valuator { Factor1 0.75 }
   ]
  }

  Transform2D {
   translation -100 -50
   children [
    Shape {
     appearance Appearance {
      material DEF M3 Material2D {
       emissiveColor 1 0 1
      }
     }
     geometry Rectangle {
      size 60 60
     }
    }
    DEF TS3 TouchSensor {}
    DEF V3 Valuator { Factor1 0.75 }
   ]
  }

  Transform2D {
   translation 100 -50
   children [
    Shape {
     appearance Appearance {
      material DEF M4 Material2D {
       emissiveColor 0 0 1
      }
     }
     geometry Rectangle {
      size 60 60
     }
    }
    DEF TS4 TouchSensor {}
    DEF V4 Valuator { Factor1 0.75 }
   ]
  }
  
  Transform2D {
   translation 0 -100
   children [
    Shape {
     appearance Appearance {
      material Material2D {
       emissiveColor 0 0 0
       filled TRUE
      }
     }
     geometry DEF TXT Text {
      string [".", "."]
      fontStyle FontStyle {
       justify ["MIDDLE"]
       size 24
      }
     }
    }
   ]
  }

  DEF C1 Conditional {
   buffer {
    REPLACE TXT.string[0] BY "KN1 got focus" 
   }
  }
  DEF RC1 Conditional {
   buffer {
    REPLACE TXT.string[1] BY "KN1 lost focus" 
   }
  }
  DEF KN1 KeyNavigator {
   sensor USE TS1
   right USE KN2
   down USE KN3
  }

  DEF C2 Conditional {
   buffer {
    REPLACE TXT.string[0] BY "KN2 got focus" 
   }
  }
  DEF RC2 Conditional {
   buffer {
    REPLACE TXT.string[1] BY "KN2 lost focus" 
   }
  }
  DEF KN2 KeyNavigator {
   sensor USE TS2
   left USE KN1
   down USE KN4
  }

  DEF C3 Conditional {
   buffer {
    REPLACE TXT.string[0] BY "KN3 got focus" 
   }
  }
  DEF RC3 Conditional {
   buffer {
    REPLACE TXT.string[1] BY "KN3 lost focus" 
   }
  }
  DEF KN3 KeyNavigator {
   sensor USE TS3
   right USE KN4
   up USE KN1
   select USE KN2
  }

  DEF C4 Conditional {
   buffer {
    REPLACE TXT.string[0] BY "KN4 got focus" 
   }
  }
  DEF RC4 Conditional {
   buffer {
    REPLACE TXT.string[1] BY "KN4 lost focus" 
   }
  }
  DEF KN4 KeyNavigator {
   sensor USE TS4
   left USE KN3
   up USE KN2
  }
  
  DEF AC1 Conditional { buffer { REPLACE KN4.setFocus BY TRUE}}
 ]
}

ROUTE TS1.isOver TO M1.filled
ROUTE TS1.isActive TO V1.inSFBool
ROUTE V1.outSFFloat TO M1.transparency
ROUTE TS1.isActive TO AC1.activate
ROUTE KN1.focusSet TO C1.activate
ROUTE KN1.focusSet TO RC1.reverseActivate

ROUTE TS2.isOver TO M2.filled
ROUTE TS2.isActive TO V2.inSFBool
ROUTE V2.outSFFloat TO M2.transparency
ROUTE KN2.focusSet TO C2.activate
ROUTE KN2.focusSet TO RC2.reverseActivate

ROUTE TS3.isOver TO M3.filled
ROUTE TS3.isActive TO V3.inSFBool
ROUTE V3.outSFFloat TO M3.transparency
ROUTE KN3.focusSet TO C3.activate
ROUTE KN3.focusSet TO RC3.reverseActivate

ROUTE TS4.isOver TO M4.filled
ROUTE TS4.isActive TO V4.inSFBool
ROUTE V4.outSFFloat TO M4.transparency
ROUTE KN4.focusSet TO C4.activate
ROUTE KN4.focusSet TO RC4.reverseActivate
