Blender Git Loki

Git Commits -> Revision 57e0d67

Revision 57e0d67 by Mitchell Stokes (master)
August 30, 2010, 00:18 (GMT)
Committing patch [#23489] add method getEventStatus() to PythonKeyboard and PythonMouse by Geoff Gollmer (gomer)

This patch makes SCA_PythonKeyboard.events and SCA_PythonMouse.events return a dictionary of all inputs (including inactive) instead of a list of active inputs.

Example usage:
import bge

if bge.logic.keyboard.events[bge.events.SPACEBAR] = bge.logic.KX_INPUT_JUST_ACTIVATED:
print("Spacebar pressed!")

A couple of changes to the patch:
* Wrap python stuff in #ifndef DISABLE_PYTHON
* Clear and decref m_event_dict in the destructors

A couple of things not related to the patch:
* Made member variables private
* Removed a commented out (and no longer used) method (SCA_PythonMouse.show())

Commit Details:

Full Hash: 57e0d677c6b935950051748713788c6532c972fa
SVN Revision: 31649
Parent Commit: cb786f0
Lines Changed: +34, -32

5 Modified Paths:

/source/gameengine/GameLogic/SCA_PythonKeyboard.cpp (+10, -13) (Diff)
/source/gameengine/GameLogic/SCA_PythonKeyboard.h (+4, -0) (Diff)
/source/gameengine/GameLogic/SCA_PythonMouse.cpp (+12, -15) (Diff)
/source/gameengine/GameLogic/SCA_PythonMouse.h (+4, -0) (Diff)
/source/gameengine/PyDoc/bge.types.rst (+4, -4) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021