首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Livecode中获取光标下的单词

如何在Livecode中获取光标下的单词
EN

Stack Overflow用户
提问于 2015-06-02 11:32:38
回答 3查看 321关注 0票数 1

如何在Livecode中获取游标下的单词。现在我正在使用下面的代码,但它现在正在工作。在我选好课文之后就能用了。

代码语言:javascript
复制
 put the selectedText of field "MytextField" into Ftext

(小的,大的,快乐的)这里有三个词,如果光标在小的,那么它分配给Ftext,它可能吗?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2015-06-02 12:18:19

尝试“mouseChunk”函数。在字段脚本中:

代码语言:javascript
复制
 on mousemove
put the value of the mouseChunk
end mousemove

应该只是票。

克雷格·纽曼

票数 2
EN

Stack Overflow用户

发布于 2015-06-02 18:27:31

mouseText函数将返回鼠标指针下面的实际文本。

代码语言:javascript
复制
on mouseMove
   put the mouseText into fText
   --> fText will contain the word pointed to; e.g. "big"
end mouseMove

mouseChunk函数返回块描述:

代码语言:javascript
复制
on mouseMove
   put the mouseChunk into fText
   --> fText will contain something like "char 7 to 9 of field 1"
end mouseMove

如果只希望单击鼠标指针下的文本,请在the clickWord处理程序中使用mouseUpthe clickChunk属性。

票数 2
EN

Stack Overflow用户

发布于 2015-06-02 19:05:35

德文的解决方案是精细和紧凑的。但是,尝试没有"mouseChunk“的”值“:

代码语言:javascript
复制
put the mouseChunk

它提供了更多的信息,特别是关于您所处的领域。

克雷格

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30594920

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档