mouseText

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the mouseText
mouseText()
Summary

Returns the word or text group under the mouse pointer.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
the mouseText
if the style of the mouseText is "group" then showDef the mouseText
Values
NameTypeDescription
return

The mouseText function returns the text that the mouse is over.

RelatedKeyword: character, words, word, field
Function: clickText, mouseCharChunk
Glossary: handler, grouped text, mouse pointer, return, chunk expression, return value
Control Structure: function
Description

Use the mouseText function within a handler to determine which word or text group the mouse pointer is hovering over, in order to take some action based on the click.

The mouseText function only returns words in a field. If the mouse pointer is not over a field, the mouseText function returns empty.

The return value contains the word the mouse pointer is over. If the textStyle of the text is "link", the return value contains the entire text group.

To get the location of the word or text group clicked, use the mouseChunk function.

Important: Words are defined a little differently by the mouseText function than the way they are used in chunk expressions. A word, for purposes of the mouseText, is any text delimited by spaces, tabs, returns, or punctuation. If the mouse pointer is over a punctuation character, only that character is returned.

Tagsui