Keyboard initial functionality commit

This commit is contained in:
John McCardle 2024-03-07 08:13:37 -05:00
commit 9d728ee902
6 changed files with 154 additions and 47 deletions

View file

@ -119,6 +119,11 @@ void GameEngine::sUserInput()
std::string name = currentScene()->action(actionCode);
currentScene()->doAction(name, actionType);
}
else if (currentScene()->key_callable != NULL && currentScene()->key_callable != Py_None)
{
PyObject* args = Py_BuildValue("(ss)", ActionCode::key_str(event.key.code).c_str(), actionType.c_str());
PyObject_Call(currentScene()->key_callable, args, NULL);
}
else
{
//std::cout << "[GameEngine] Action not registered for input: " << actionCode << ": " << actionType << std::endl;