Committing patch "[#29763] Adding an active_events property to SCA_PythonKeyboard...
authorMitchell Stokes <mogurijin@gmail.com>
Sun, 22 Jan 2012 05:45:56 +0000 (05:45 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Sun, 22 Jan 2012 05:45:56 +0000 (05:45 +0000)
commit57d48d4493a78d2886f83a28fe66c2654bed4f6c
tree205e5116b6f6dd9f6031fb1a858559a240b6abbf
parent4ec5a9a42c00d65898e8a4aef5b73409a5e1785f
Committing patch "[#29763] Adding an active_events property to SCA_PythonKeyboard and SCA_PythonMouse"

Here is the description:
As the summary says, this patch adds a new event to both SCA_PythonKeyboard and SCA_PythonMouse. This property is similar to the events property that both have, but it only returns events which are not KX_NO_INPUTSTATUS. This moves the "no input" check from Python to C, which gave my input handling code a 2x speed up. Python sucks (performance-wise) with iterating lists and SCA_PythonKeyboard has close to 200 events (I think something like 177, but I don't know for sure).
doc/python_api/rst/bge.types.rst
source/gameengine/GameLogic/SCA_PythonKeyboard.cpp
source/gameengine/GameLogic/SCA_PythonKeyboard.h
source/gameengine/GameLogic/SCA_PythonMouse.cpp
source/gameengine/GameLogic/SCA_PythonMouse.h