       value = value.substr(0, @element.maxLength)
 
     @element.value = ''
-    this.trigger('focus')    
+    this.trigger('focus')
 
     for char in value
       @element.value += char
 
       keyCode = this.characterToKeyCode(char)
       this.keyupdowned('keydown', keyCode)
-      this.keypressed(false, false, false, false, char.charCodeAt(0), char.charCodeAt(0))      
+      this.keypressed(false, false, false, false, char.charCodeAt(0), char.charCodeAt(0))
       this.keyupdowned('keyup', keyCode)
 
     this.changed()

    event.keyCode  = keyCode
    event.which    = keyCode
    event.charCode = 0
    @element.dispatchEvent(event)    

  keypressed: (altKey, ctrlKey, shiftKey, metaKey, keyCode, charCode) ->
    event = document.createEvent('UIEvents')


  characterToKeyCode: (character) ->
    code = character.toUpperCase().charCodeAt(0)
    specialKeys =
      96: 192  #`
      45: 189  #-
      61: 187  #=
