From 4669fa48a82f5f1070cf885cd1714e0a8ff8db3a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Apr 2009 16:00:45 +0000 Subject: Added GameKeys.EventToCharacter(event, is_shift) so you can get the character that would be types when pressing a key. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last commit was made in the pydocs folder only, so this includes changes mentioned in rev 19620. --- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 38 ++++++++++++++---------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'source/gameengine/GameLogic/SCA_KeyboardSensor.h') diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index c579b6a82f8..eb26afc96ff 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -81,22 +81,6 @@ class SCA_KeyboardSensor : public SCA_ISensor */ void AddToTargetProp(int keyIndex); - /** - * Determine whether this character can be printed. We cannot use - * the library functions here, because we need to test our own - * keycodes. */ - bool IsPrintable(int keyIndex); - - /** - * Transform keycodes to something printable. - */ - char ToCharacter(int keyIndex, bool shifted); - - /** - * Tests whether this is a delete key. - */ - bool IsDelete(int keyIndex); - /** * Tests whether shift is pressed. */ @@ -152,7 +136,29 @@ public: KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,getEventList); // KeyStatus: KX_PYMETHOD_DOC_O(SCA_KeyboardSensor,getKeyStatus); + + static PyObject* pyattr_get_events(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); }; + +/** + * Transform keycodes to something printable. + */ +char ToCharacter(int keyIndex, bool shifted); + +/** + * Determine whether this character can be printed. We cannot use + * the library functions here, because we need to test our own + * keycodes. */ +bool IsPrintable(int keyIndex); + +/** + * Tests whether this is a delete key. + */ +bool IsDelete(int keyIndex); + + #endif //__KX_KEYBOARDSENSOR + + -- cgit v1.2.3