首页 > 解决方案 > Apache Royale:如何检测 j:textInput 上的输入键

问题描述

我有这个代码:

<j:TextInput localId="ti_pass"  >
    <j:beads><j:PasswordInput/></j:beads>
</j:TextInput>

不幸的是,看着https://apache.github.io/royale-docs/component-sets/jewel/textinput我没有找到 KeyDown 事件的珠子。是否有特定的事件来监听它?

有没有办法知道是否按下了输入键?

感谢和问候

标签: keyboard-eventstextinputapache-royale

解决方案


我必须说你的问题有更好的解决方案,但由于专注于 keydown,我完全忘记了。对不起。

enter在 TextInput 中有一个可以直接使用的事件。示例在 TextInputPlayGround 的 Tour De Jewel 中。

private function enterPress(event:Event):void
{
    trace("enter pressed");
}
<j:TextInput text="A TextInput" enter="enterPress(event)"/>

高温高压

卡洛斯


推荐阅读