]> Dogcows Code - chaz/openbox/blobdiff - src/python.cc
some intermediate stage. stacked focus cycling is very broken. dont try it. going...
[chaz/openbox] / src / python.cc
index 9905dec59b2dd93211793b9b451c6bec3d773d3b..ff02d6d4022843d936b6fa8009e74914b233f499 100644 (file)
@@ -123,6 +123,26 @@ PyObject *ebind(ob::EventAction action, PyObject *func)
   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)) {
This page took 0.024066 seconds and 4 git commands to generate.