Events used by Peng3d¶
See also
This document describes the events used by peng3d, see
peng3d.peng.Peng.sendEvent() for information about the event system itself.
Note that there is no completely safe way to get a list of all events used by an
application, but you should get most events by setting the config value
debug.events.dumpfile to a valid file name and running the application in
question. Make sure to trigger all events, or else they may not appear in the list.
This document is sectioned after the categories of events used.
Note that many applications will add their own events, which should be listed in their documentation.
Peng3d Events using sendEvent()¶
Events listed here can be sent via the sendEvent()
method and be received via addEventListener().
If possible, this system should be used, as it is better and has many improvements over previous systems.
Most of these events use a dictionary containing at least the peng key as their data parameter.
Special events¶
These events are special and should not be sent manually, they are mostly for backwards-compatibility.
-
peng3d:pyglet¶ Special event sent by
sendPygletEvent()for compatibility.Additional parameters:
argsis a list of the given parameters.windowis the window this event originated from.srcis the object this event was sent via.event_typeis the pyglet event type.See also
See
pyglet:*for another way of accessing pyglet events.
-
pyglet:*¶ Special event sent by
sendPygletEvent()for compatibility.See
peng3d:pygletfor more information on the given parameters.
peng3d:peng.* Events Category¶
These events are typically sent by the main Peng() instance.
-
peng3d:peng.run¶ Triggered once when calling
run()just before starting the event loop.Additional parameters are
windowset to the main window object andevloopset to the argument of the same name.
-
peng3d:peng.exit¶ Triggered once the pyglet event loop exits.
Note that the calling method may cause the program to continue running.
This event has no additional parameters.
peng3d:window.* Events Category¶
These events are sent to mark changes to an instance of PengWindow().
Note that some of these events are not sent by the window itself and do not require a window to exist.
-
peng3d:window.create.pre¶ -
peng3d:window.create¶ -
peng3d:window.create.post¶ These events are sent when the main window is created.
The event
peng3d:window.create.prehas the additional parameterclscontaining the class used to create the window.The events
peng3d:window.createandpeng3d:window.create.postboth have the additional parameterwindowset to the window object.Note that the
windowattribute ofPeng()is only available after the handling ofpeng3d:window.createhas finished.
Triggered whenever a menu is added to the window.
Additional parameters are
windowset to the window object andmenuset to the menu object.
Triggered whenever the active menu is changed.
This event is sent after other event handlers have finished processing.
Additional parameters:
windowis the current window object.oldis the name of the old menu. This may beNoneif there was no active menu.menuis the name of the new menu.
-
peng3d:window.toggle_exclusive¶ Triggered whenever the mouse exclusivity is changed via
toggle_exclusivity().Additional parameters are
windowset to the window object andexclusiveset to the current exclusivity state.
peng3d:rsrc.* Events Category¶
These events are sent by the ResourceManager() to
signal that either the manager itself was modified or a resource was changed.
-
peng3d:rsrc.init.pre¶ -
peng3d:rsrc.init¶ -
peng3d:rsrc.init.post¶ These events are sent when the resource manager is first initialized.
The event
peng3d:rsrc.init.prehas the additional parameterbasepathcontaining the base path of the new resource manager.The events
peng3d:rsrc.initandpeng3d:rsrc.init.postboth have the additional parameterrsrcMgrset to the newly created resource manager.Note that the
resourceMgrattribute ofPeng()is only available after the handling ofpeng3d:rsrc.inithas finished.
-
peng3d:rsrc.category.add¶ Sent when a new resource category is added.
The additional parameter
categoryis set to the name of the new category.
-
peng3d:rsrc.tex.load¶ Sent when a texture resource is first loaded.
Additional parameters are
nameandcategoryset to their corresponding arguments given toloadTex().
-
peng3d:rsrc.model.load¶ Sent when a model resource is first loaded.
Additional parameters are
nameset to the name of the model.
peng3d:i18n.* Events Category¶
See also
See TranslationManager() for more information about the translation system.
-
peng3d.i18n.set_lang¶ Sent whenever the default language is set.
Note that this event is sent regardless of whether or not the language actually changed.
Additional parameters are
i18n, set to the translation manager, andlangset to the new language.
peng3d:keybind.* Events Category¶
These events usually mark an event related to a specific key combination.
See also
See KeybindHandler() for more information on the keybind system.
-
peng3d:keybind.add¶ Triggered when a keybind is added to the system.
Additional parameters are all arguments given to
add().
-
peng3d:keybind.change¶ Triggered when a keybind is changed.
Additional parameters are all arguments given to
changeKeybind().
-
peng3d:keybind.combo¶ -
peng3d:keybind.combo.press¶ -
peng3d:keybind.combo.release¶ These events are triggered whenever a key combination is detected.
Note that this event will be sent regardless of whether or not there are any handlers registered for the keybind in question.
peng3d:keybind.combois always sent, and depending on thereleaseflag, eitherpeng3d:keybind.combo.pressorpeng3d:keybind.combo.releaseis also sent.Additional parameters are the same as the arguments given to
handle_combo().
Pyglet Events using sendPygletEvent()¶
Events listed here can be sent via the sendPygletEvent()
method and be received via addPygletListener().
There are also several events sent by pyglet itself, see the Pyglet Docs for more information.
Todo
Add docs for custom pyglet events.