OrderedGroup { 
  children [
  
    ##Hack to have the display refreshed
    DEF TS TimeSensor {
 	loop	TRUE
    }
    DEF CI ColorInterpolator {
    	key		[0, 1]
 	keyValue	[0 0 0, 0 0 0.01]
    }
    DEF BG Background2D {
      backColor 0 0 0
    }

    ##KeySensor display
    Transform2D {
      translation 0 0
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance DEF A1 Appearance {
                material Material2D {
                  emissiveColor 1 1 1
                }
              }
              geometry DEF L1 Text {
              	string "keyPress" 
              	fontstyle DEF F1 FontStyle {
                  size 20
              	}
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T1 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V1 Valuator {}
      ]
    }
    Transform2D {
      translation 0 -25
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance USE A1 
              geometry DEF L2 Text {
              	string "keyRelease" 
              	fontstyle USE F1 
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T2 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V2 Valuator {}
      ]
    }
    Transform2D {
      translation 0 -50
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance USE A1 
              geometry DEF L3 Text {
              	string "actionKeyPress" 
              	fontstyle USE F1 
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T3 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V3 Valuator {}
      ]
    }
    Transform2D {
      translation 0 -75
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance USE A1 
              geometry DEF L4 Text {
              	string "actionKeyRelease" 
              	fontstyle USE F1 
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T4 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V4 Valuator {}
      ]
    }
    Transform2D {
      translation 0 -100
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance USE A1 
              geometry DEF L5 Text {
              	string "shiftKey_changed" 
              	fontstyle USE F1 
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T5 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V5 Valuator {}
      ]
    }    
    Transform2D {
      translation 0 -125
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance USE A1 
              geometry DEF L6 Text {
              	string "controlKey_changed" 
              	fontstyle USE F1 
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T6 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V6 Valuator {}
      ]
    }    
    Transform2D {
      translation 0 -150
      children [
        Transform2D {
          translation -200 0
          children [
            Shape {
              appearance USE A1 
              geometry DEF L7 Text {
              	string "altKey_changed" 
              	fontstyle USE F1 
              }
            }
          ]
        }
        Shape {
          appearance USE A1
          geometry DEF T7 Text {
            string "0"
            fontstyle USE F1
          }
        }
        DEF V7 Valuator {}
      ]
    }    
    
    ## KeySensor
    InputSensor { 
	url [ "10" ]
	buffer {
	  REPLACE V1.inSFInt32 BY  0
	  REPLACE V2.inSFInt32 BY  0
	  REPLACE V3.inSFInt32 BY  0
	  REPLACE V4.inSFInt32 BY  0
	  REPLACE V5.inSFBool BY  TRUE
	  REPLACE V6.inSFBool BY  TRUE
	  REPLACE V7.inSFBool BY  TRUE
       }
    }
  ]
}
## display the KeySensor fields
route V1.outMFString to T1.string
route V2.outMFString to T2.string
route V3.outMFString to T3.string
route V4.outMFString to T4.string
route V5.outMFString to T5.string
route V6.outMFString to T6.string
route V7.outMFString to T7.string

## Hack for refreshing the display
route TS.fraction_changed to CI.set_fraction
## route CI.value_changed to M1.emissiveColor
route CI.value_changed to BG.backColor

AT 0 {
 UPDATE OD [
   ObjectDescriptor {
     objectDescriptorID 10
     esdescr [
       ES_Descriptor {
         es_id 2
	 URLstring "Web3Dkeyboard:"
	 streamPriority 16
	 decConfigDescr DecoderConfigDescriptor {
	   objectTypeIndication 255
	   streamType 9
	   upStream false
	   bufferSizeDB 100000
	   maxBitrate 0
	   avgBitrate 0
	   decSpecificInfo UIConfig {
	     pixelWidth 320
	     pixelHeight 200
	     nodeIDBits 10
	     protoIDBits 10
	     deviceURL "Web3Dkeyboard:"
	   }
	 }
        slConfigDescr SLConfigDescriptor {
        }
      }
    ]
   }
 ] # end UPDATE OD
}