Py_INCREF(Py_None); return Py_None;
}
+PyObject *kgrab(int screen, PyObject *func)
+{
+ if (!PyCallable_Check(func)) {
+ PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
+ return NULL;
+ }
+
+ if (!ob::openbox->bindings()->grabKeyboard(screen, func)) {
+ PyErr_SetString(PyExc_RuntimeError,"Unable to grab keybaord.");
+ return NULL;
+ }
+ Py_INCREF(Py_None); return Py_None;
+}
+
+PyObject *kungrab()
+{
+ ob::openbox->bindings()->ungrabKeyboard();
+ Py_INCREF(Py_None); return Py_None;
+}
+
PyObject *kbind(PyObject *keylist, ob::KeyContext context, PyObject *func)
{
if (!PyCallable_Check(func)) {
ob::openbox->bindings()->setResetKey(key);
}
-PyObject *send_client_msg(Window target, int type, Window about,
+PyObject *send_client_msg(Window target, Atom type, Window about,
long data, long data1, long data2,
long data3, long data4)
{
- if (type < 0 || type >= otk::Property::NUM_ATOMS) {
- PyErr_SetString(PyExc_TypeError,
- "Invalid atom type. Must be from otk::Property::Atoms");
- return NULL;
- }
-
XEvent e;
e.xclient.type = ClientMessage;
e.xclient.format = 32;
- e.xclient.message_type =
- openbox->property()->atom((otk::Property::Atoms)type);
+ e.xclient.message_type = type;
e.xclient.window = about;
e.xclient.data.l[0] = data;
e.xclient.data.l[1] = data1;