Search code examples
blenderblender-2.50

Blender game engine events with python


We're searching for a way to script events in BGE instead of using there build in GUI version where you are using your mouse to make events trigger your scripts. Isn't there a way to use events with python directly? Thanks in advance.


Solution

  • The only way to bypass the BGE event system is to read events with Python (which by it's nature inefficient).

    You can read keyboard and mouse events or verify the scene with own algorithms.

    I suggest to trigger code that depends on keyboard events with a keyboard sensor (allKeys mode) to get a better performance rather then an always sensor.