Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/GameLogic/SCA_KeyboardSensor.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
index b3346270b61..7005ea1ba5b 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
@@ -439,17 +439,18 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
return NULL;
}
- int keycode = PyLong_AsSsize_t(value);
+ SCA_IInputDevice::KX_EnumInputs keycode = (SCA_IInputDevice::KX_EnumInputs)PyLong_AsLong(value);
- if ((keycode < SCA_IInputDevice::KX_BEGINKEY)
- || (keycode > SCA_IInputDevice::KX_ENDKEY)) {
+ if ((keycode < SCA_IInputDevice::KX_BEGINKEY) ||
+ (keycode > SCA_IInputDevice::KX_ENDKEY))
+ {
PyErr_SetString(PyExc_AttributeError, "sensor.getKeyStatus(int): Keyboard Sensor, invalid keycode specified!");
return NULL;
}
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
- const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) keycode);
- return PyLong_FromSsize_t(inevent.m_status);
+ const SCA_InputEvent & inevent = inputdev->GetEventValue(keycode);
+ return PyLong_FromLong(inevent.m_status);
}
/* ------------------------------------------------------------------------- */
@@ -509,8 +510,8 @@ PyObject *SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU
if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS)
{
PyObject *keypair = PyList_New(2);
- PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i));
- PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
+ PyList_SET_ITEM(keypair,0,PyLong_FromLong(i));
+ PyList_SET_ITEM(keypair,1,PyLong_FromLong(inevent.m_status));
PyList_Append(resultlist,keypair);
}
}