Librocket API Event

From FreeSpace Wiki
Revision as of 19:10, 22 April 2023 by MjnMixael (talk | contribs) (Created page with "{{Librocket_API}} When an event is sent to Lua, three global variables are set up in the context of the called function. *event - The event object *document - The document in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Librocket API references
Elements
Documents
Contexts
Events
API Reference

When an event is sent to Lua, three global variables are set up in the context of the called function.

  • event - The event object
  • document - The document in which the event fired
  • self - The element context in which the event fired

Event Interface

Properties

Python property Brief description Equivalent method
current_element The current element in the event propagation. GetCurrentElement()
target_element The element the event was originally targeted at. GetTargetElement()
type The type of the event. GetType()
parameters Dictionary style container of all the parameters in the event GetParameters()

Methods

Events have a single Python method, StopPropagation(), which interrupts the event propagation if allowed by the event (ie, if it is interruptible).