检测 RichEditableText 上的右键单击
我目前正在 Flex 应用程序中实现 squiggly 以启用拼写检查。由于某些要求,我无法使用 SquigglyUI 来连接我的 Spark RichEditableText。我已成功使用 com.adobe.linguistics.utils.TextTokenizer 来标记并突出显示拼写错误的单词。
我希望能够让用户右键单击拼写错误的单词,并使用 getSuggestions
在上下文菜单中显示建议列表。
我尝试将侦听器附加到我的 RichEditableText:
richtexteditor.addEventListener("rightClick", showSuggestions);
这是我的事件处理程序:
private function showSuggestions(event:MouseEvent):void{
trace('hi there');
}
问题是在调试应用程序时,我从未在控制台中获得跟踪,因为从未调度右键单击事件。此外,我需要检测用户右键单击的单词。我该如何执行此操作以及如何检测右键单击?
干杯
I am currently implementing squiggly in a flex application to enable spell checking. Due to certain requirements, I can not use SquigglyUI to hook onto my spark RichEditableText. I have successfully used com.adobe.linguistics.utils.TextTokenizer
to tokenize and highlight mispelt words.
I would like to be able to let the user rightclick on a mispelled word and show a list of suggestions in the context menu using getSuggestions
.
I have tried to attach a listener to my RichEditableText:
richtexteditor.addEventListener("rightClick", showSuggestions);
And this is my event handler:
private function showSuggestions(event:MouseEvent):void{
trace('hi there');
}
The problem is when debugging the application, I never get the trace in my console as the rightclick event is never dispatched. In addition, I need to detect the word the user has right clicked on. How can I go about doing this and how can I detect right clicks?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我所要做的就是向 Richeditable 文本的 contextmenu 属性添加一个事件处理程序:
All I had to do was add an event handler to the contextmenu property of the richeditable text:
这将监听鼠标右键(Flex4.5)
This will listen for the right-click of the mouse (Flex4.5)