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:
args
is a list of the given parameters.window
is the window this event originated from.src
is the object this event was sent via.event_type
is 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:pyglet
for 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
window
set to the main window object andevloop
set 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.pre
has the additional parametercls
containing the class used to create the window.The events
peng3d:window.create
andpeng3d:window.create.post
both have the additional parameterwindow
set to the window object.Note that the
window
attribute ofPeng()
is only available after the handling ofpeng3d:window.create
has finished.
Triggered whenever a menu is added to the window.
Additional parameters are
window
set to the window object andmenu
set to the menu object.
Triggered whenever the active menu is changed.
This event is sent after other event handlers have finished processing.
Additional parameters:
window
is the current window object.old
is the name of the old menu. This may beNone
if there was no active menu.menu
is the name of the new menu.
-
peng3d:window.toggle_exclusive
¶ Triggered whenever the mouse exclusivity is changed via
toggle_exclusivity()
.Additional parameters are
window
set to the window object andexclusive
set 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.pre
has the additional parameterbasepath
containing the base path of the new resource manager.The events
peng3d:rsrc.init
andpeng3d:rsrc.init.post
both have the additional parameterrsrcMgr
set to the newly created resource manager.Note that the
resourceMgr
attribute ofPeng()
is only available after the handling ofpeng3d:rsrc.init
has finished.
-
peng3d:rsrc.category.add
¶ Sent when a new resource category is added.
The additional parameter
category
is set to the name of the new category.
-
peng3d:rsrc.tex.load
¶ Sent when a texture resource is first loaded.
Additional parameters are
name
andcategory
set to their corresponding arguments given toloadTex()
.
-
peng3d:rsrc.model.load
¶ Sent when a model resource is first loaded.
Additional parameters are
name
set 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, andlang
set 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.combo
is always sent, and depending on therelease
flag, eitherpeng3d:keybind.combo.press
orpeng3d:keybind.combo.release
is 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.