Adobe AIR 2 未检测到 TLF TextField 内的输入

发布于 2024-11-27 04:42:02 字数 372 浏览 3 评论 0原文

此代码在 Flash 中工作,但是当我尝试使用 adobe air 2 运行时,未检测到 Enter 键,而是 ctrl+enter 工作。如何获得这项工作?提前输入

txtTLF 是 TLF TEXT EDITABLE

import flash.events.TextEvent;

txtTLF.addEventListener(TextEvent.TEXT_INPUT, teclado);
function teclado(e:TextEvent):void{
    if(e.text == String.fromCharCode(13)){
        e.preventDefault();
        code();
    }
}

This code work in flash, but when i try run using adobe air 2, the enter key is not detected, but instead ctrl+enter work. how to get this work? Ty in advance

txtTLF is TLF TEXT EDITABLE

import flash.events.TextEvent;

txtTLF.addEventListener(TextEvent.TEXT_INPUT, teclado);
function teclado(e:TextEvent):void{
    if(e.text == String.fromCharCode(13)){
        e.preventDefault();
        code();
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅此而已 2024-12-04 04:42:02

我找到了答案,不要忘记真相,代码是:

txtTLF.addEventListener(KeyboardEvent.KEY_DOWN, teclado, true);
function teclado(e:KeyboardEvent):void{
    if(e.keyCode == 13){
        e.preventDefault();
        code();
    }
}

I find the answer, DONT FORGET THE TRUE, the code is:

txtTLF.addEventListener(KeyboardEvent.KEY_DOWN, teclado, true);
function teclado(e:KeyboardEvent):void{
    if(e.keyCode == 13){
        e.preventDefault();
        code();
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文