-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Im trying to modify your library so it supports the inbuilt sendkeypress (and sendkeyrelease), but am having issues, here is what I have come up with so far (it appears to work, but nothing happens and it crashes with a stack smash):
static PyObject * Device_send_key_press(Device * self, PyObject * args) {
unsigned char keycode;
bool bWait;
cec_user_control_code keypress;
if( PyArg_ParseTuple(args, "bp:sendkeypress", &keycode,
&bWait) ) {
keypress = (cec_user_control_code) keycode;
bool success;
Py_BEGIN_ALLOW_THREADS
cec_logical_address destination = self->addr;
success = adapter->SendKeypress(destination, keypress, bWait);
Py_END_ALLOW_THREADS
if( success ) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
} else {
return NULL;
}
}
Metadata
Metadata
Assignees
Labels
No labels