简体   繁体   中英

Adobe Air - Starling/Feathers - Text Input without OS level hooks (aka StageText)?

Long story short, I seem to always be running into unpredictable StageText functionality in Adobe AIR applications. I want to avoid triggering the OS native input fields and emulate that functionality in a Feathers/Actionscript component directly.

I've incorporated an on-screen keyboard purely in Feathers and implemented a Button subclass that acts like a basic text input. When the user clicks the button, the on-screen keyboard is displayed and hardware keyboard KEYUP's are intercepted and used to dynamically update the button label attribute.

That all works well enough, but of course I have no flashing cursor or text selectability in my current rudimentary widget. I can continue along my current path and manually implement the rest of what I need, but wanted to ask if anyone has seen or implemented a 'native acting' non-native text input widget in the Feathers/Starling/Actionscript tech stack? (Google seems to say no, but I'm hoping that's wrong. Surely I'm not the only one that thinks AIR's StageText is... troublesome... at best)

I changed my rudimentary widget from a Button subclass to a TextInput with editor factory returning a custom flash.text.TextField that has it's SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING being nixed via preventDefault().

I now have most of what I wanted from my basic text input functionality in that I now have a text widget I can click in and select text and have all the simple cursor functionality I was missing. This still prevents the flaky native-softkeyboard interaction so I think this might suffice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM