AS3 AIR RequestSoftKeyboard not working on Windows

和自甴很熟 提交于 2020-01-17 04:59:07

问题


I tried to launch a virtual keyboard on Windows using this:

_txtInputName = new TextField();
_txtInputName.type = TextFieldType.INPUT;
_txtInputName.needsSoftKeyboard = true;
_txtInputName.addEventListener(FocusEvent.FOCUS_IN, onFocus );

private function onFocus(e:FocusEvent):void
{
    _txtInputName.requestSoftKeyboard();
}

Unfortunaly, the softkeyboard doesn't show up. Am I missing something? Does I have to add something on the application.xml?

Thank you so much!


回答1:


TextField is not an object type compatible with native keyboard handling. As a coder using a TextField does mean not using native keyboard at all. SO simple answer to your question is this:

Of course it's not working since it's not mean to.

Next: To provide native keyboard support on the AIR platform the StageText built-in class was implemented and is the one any coder wanting to handle native keyboard should use. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html



来源:https://stackoverflow.com/questions/33186093/as3-air-requestsoftkeyboard-not-working-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!