Fandom

Livecode Wiki

Mousechunk

1,968pages on
this wiki
Add New Page
Comments0 Share

Returns a chunk expression describing the location of the word or text group under the mouse pointer.

Syntax:

the mouseChunk
mouseChunk()

Examples:

the mouseChunk
if the shiftKey is down then select the mouseChunk

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

The mouseChunk function returns a chunk expression of the form char startChar to endChar of field fieldNumber, example:

char 8 to 12 of field 1

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

The return value reports the word the mouse is over. The startChar is the first character of the word, and the endChar is the last character. If the textStyle of the text is "link", the return value specifies the entire text group.

To get the text of the word or text group, use the mouseText function.

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

See Also: mouseCharChunk Function, selectedChunk Function, dropChunk Function

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.