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

@ -39,3 +39,21 @@ bool Scene::unregisterActionInjected(int code, std::string name)
{
return false;
}
void Scene::key_register(PyObject* callable)
{
if (key_callable)
{
// decrement reference before overwriting
Py_DECREF(key_callable);
}
key_callable = callable;
Py_INCREF(key_callable);
}
void Scene::key_unregister()
{
if (key_callable == NULL) return;
Py_DECREF(key_callable);
key_callable = NULL;
}