Skip to main content
Mar 31, 2009 9:55 AM UTC
Question

TLF keyboard input

Hello,

in the forum I read "TLF has full support for keyboard input"...
Someone can get an example?

Thanks.
This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

Adobe Employee
Apr 1, 2009 4:01 PM UTC
There are several different ways to get keyboard input. If you attach an EditManager as the interactionManager for a TextFlow, most keyboard input is handled automatically. There are examples of this posted on the Labs TLF site: http://labs.adobe.com/downloads/textlayout.html, look particularly at the ActionScript examples, see EditText.as.

If you want to override the processing TLF does by default, there are several ways. You can, as tdminh81 suggests, override FlowOperations. Or you can derive from EditManager and override the keyDownHandler function. Or you can even derive from DisplayObjectContainerController and catch the event earlier in the sequence.
Translate
Apr 1, 2009 2:25 PM UTC
be patient with Adobe. TLF is changing :) many bad stuffs but i hope they will be cleared out. For now clean OOP is not possible.
Translate
Apr 1, 2009 10:17 AM UTC
if(e.operation is InsertTextOperation){

var op:InsertTextOperation = e.operation as InsertTextOperation;
distance = Math.abs(absoluteStart-op.absoluteStart);

// TAB processing
if(op.text == '\t' ){
bm = listManager.getBulletMapByPara(p);
if(bm != null){
if(bm.hasPara(p)){
if(distance <= 2){
e.preventDefault();
if(bm.isParaFirst(p)){
bm.setMargin(bm.margin+20);
}else{//not first line
var newbm:BulletMap = new BulletMap();
newbm.parentMap = bm;
bm.childMap = newbm;
newbm.margin = bm.margin+20;

bm.removePara(p);
newbm.addPara(p);
listManager.bulletMaps.addItem(newbm);
}
}
}
}else{.........

this is handler of FlowOperationBegin.
Hope this helps
Translate
Apr 1, 2009 10:36 AM UTC
Thanks tdminh81....

I work from 6 years as webdeveloper (.net/java) and this "textLayout" for me it's the worst object class that I used....
For me this project will be the last on Adobe technology.
Translate
Participating Frequently
Apr 2, 2009 5:38 AM UTC
> I work from 6 years as webdeveloper (.net/java) and this "textLayout" for me it's the worst object class that I used

Fabio, can you give some specific examples of what you don't like about TLF?
Translate
Apr 1, 2009 8:57 AM UTC
no one suggestion?
Translate