in FF, i've used this code:
74 if (keyCount == lineLimit) {
75 // method in FF, no Chrome
76 var mock = document.createEvent("KeyboardEvent"); // or KeysEvent
77 mock.initKeyEvent("keypress",true,true,null,false,false,false,false,14,0);
78 var x = document.getElementById('InputCategory');
79 // rise height before Enter
80 $(this).height(div_height + font_height + offset_height);
81 // mock Enter
82 x.dispatchEvent(mock);
83 // init keyCount
84 keyCount = 0;
85 }
it works, but could not be effective on webkit-based browsers like chrome.
so i asked google and found keyboard event is one of the DOM Level 3 events,here is an aticle:
http://www.w3.org/TR/DOM-Level-3-Events/
then i knew /* initKeyboardEvent */ is not supported on chrome & safari, /* initUIEvent */ i've tried, it didn't work also.
Do virtual keyboard events reall can be simulated on chrome ? plesase help me :)