MouseLib2

by Ter13
Interact with the mouse more easily and more concisely
ID:2608397
 
Resolved
/mouse_action datums can now store arbitrary data.

You can store this data by doing indexed assignment on the mouse action:
mouse_action["new-data"] = value


You can read this information back by indexing the mouse_action:
if(mouse_action["new-data"])
//do the thing


This data is stored in the mouse_action.data list internally, starting at index 9 and beyond. Because this data is collocated with the existing values permitted to index on mouse_actions, you should use names that do not conflict with the existing values.

This data persists for the entire lifetime of the mouse action datum, which means that data stored during a hover action will persist until after MouseUp or MouseDrop is called.
Applies to:mouselib2
Status: Resolved (1.1a)

This issue has been resolved.
It would be nice to be able to store arbitrary data in mouse actions. This would allow information to persist across an entire drag, hover, or hold action, so that the various mouse procs can interact with one another across multiple frames in a way that doesn't require the developer to build in new client variables.
Ter13 resolved issue with message:
/mouse_action datums can now store arbitrary data.

You can store this data by doing indexed assignment on the mouse action:
mouse_action["new-data"] = value


You can read this information back by indexing the mouse_action:
if(mouse_action["new-data"])
//do the thing


This data is stored in the mouse_action.data list internally, starting at index 9 and beyond. Because this data is collocated with the existing values permitted to index on mouse_actions, you should use names that do not conflict with the existing values.

This data persists for the entire lifetime of the mouse action datum, which means that data stored during a hover action will persist until after MouseUp or MouseDrop is called.