2 Replies Latest reply on Jan 7, 2009 1:58 PM by Pavel_CZ

    TextInput Bug

    Pavel_CZ
      While typing letter "č" or "4" into TextInput object using Czech keyboard there
      is alway a new line inserted, too. It is probably a bug in Adobe AIR.

      Changing the keybord from CS to EN solves the problem as well as typing "4"
      using numpad.

      As far as I know there is no other letters (e.g. "#", "3" etc.) causing this strange
      behavior.

      How to solve this? Thanks for any suggestions.
        • 1. Re: TextInput Bug
          flexstone Level 1
          You might add a keyboard listener event that would evaluate each character typed and perform validation / substitution.......
          • 2. Re: TextInput Bug
            Pavel_CZ Level 1
            Thanks. It works.

            private function init():void{
            myTextInput.addEventListener(KeyboardEvent.KEY_DOWN,repair);
            }

            private function repair(e:KeyboardEvent):void{
            if ((e.charCode == 13) && (e.keyCode == 52)){
            e.preventDefault();
            if (e.shiftKey) {
            myTextInput.text = myTextInput.text.substring(0,myTextInput.selectionBeginIndex) + "4" + myTextInput.text.substring(myTextInput.selectionBeginIndex,myTextInput.text.length);
            }else{
            myTextInput.text = myTextInput.text.substring(0,myTextInput.selectionBeginIndex) + "č" + myTextInput.text.substring(myTextInput.selectionBeginIndex,myTextInput.text.length);
            }
            myTextInput.setSelection(myTextInput.selectionBeginIndex+1, myTextInput.selectionBeginIndex+1);
            }
            }