如何在Livecode中获取游标下的单词。现在我正在使用下面的代码,但它现在正在工作。在我选好课文之后就能用了。
put the selectedText of field "MytextField" into Ftext(小的,大的,快乐的)这里有三个词,如果光标在小的,那么它分配给Ftext,它可能吗?
发布于 2015-06-02 12:18:19
尝试“mouseChunk”函数。在字段脚本中:
on mousemove
put the value of the mouseChunk
end mousemove应该只是票。
克雷格·纽曼
发布于 2015-06-02 18:27:31
mouseText函数将返回鼠标指针下面的实际文本。
on mouseMove
put the mouseText into fText
--> fText will contain the word pointed to; e.g. "big"
end mouseMovemouseChunk函数返回块描述:
on mouseMove
put the mouseChunk into fText
--> fText will contain something like "char 7 to 9 of field 1"
end mouseMove如果只希望单击鼠标指针下的文本,请在the clickWord处理程序中使用mouseUp或the clickChunk属性。
发布于 2015-06-02 19:05:35
德文的解决方案是精细和紧凑的。但是,尝试没有"mouseChunk“的”值“:
put the mouseChunk它提供了更多的信息,特别是关于您所处的领域。
克雷格
https://stackoverflow.com/questions/30594920
复制相似问题