Keyboard initial functionality commit
This commit is contained in:
parent
9587218b28
commit
9d728ee902
6 changed files with 154 additions and 47 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue