diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-12-31 06:59:46 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-12-31 06:59:46 +0000 |
| commit | a6661d587cd043e1894418c091b8dbd4e18a7d55 (patch) | |
| tree | b0baafd6222cc77d688ffb3477d48f4fe3ae4bd2 /otk | |
| parent | d7a30f93b517ac76816d0acea92e9c56ad5d6594 (diff) | |
bindings work. now they have a reset key too.
Diffstat (limited to 'otk')
| -rw-r--r-- | otk/display.cc | 19 | ||||
| -rw-r--r-- | otk/display.hh | 2 | ||||
| -rw-r--r-- | otk/otk_wrap.cc | 64 |
3 files changed, 84 insertions, 1 deletions
diff --git a/otk/display.cc b/otk/display.cc index 7fafed0c..f45dd49b 100644 --- a/otk/display.cc +++ b/otk/display.cc @@ -227,5 +227,24 @@ void OBDisplay::ungrabButton(unsigned int button, unsigned int modifiers, grab_window); } +void OBDisplay::grabKey(unsigned int keycode, unsigned int modifiers, + Window grab_window, bool owner_events, + int pointer_mode, int keyboard_mode, + bool allow_scroll_lock) +{ + unsigned int length = (allow_scroll_lock) ? 8 / 2: + 8; + for (size_t cnt = 0; cnt < length; ++cnt) + XGrabKey(otk::OBDisplay::display, keycode, modifiers | _mask_list[cnt], + grab_window, owner_events, pointer_mode, keyboard_mode); +} + +void OBDisplay::ungrabKey(unsigned int keycode, unsigned int modifiers, + Window grab_window) +{ + for (size_t cnt = 0; cnt < 8; ++cnt) + XUngrabKey(otk::OBDisplay::display, keycode, modifiers | _mask_list[cnt], + grab_window); +} } diff --git a/otk/display.hh b/otk/display.hh index 9b3d6b31..0ebd4140 100644 --- a/otk/display.hh +++ b/otk/display.hh @@ -116,7 +116,7 @@ public: static void grabKey(unsigned int keycode, unsigned int modifiers, Window grab_window, bool owner_events, int pointer_mode, int keyboard_mode, bool allow_scroll_lock); - static void ungrabKey(unsigned int button, unsigned int modifiers, + static void ungrabKey(unsigned int keycode, unsigned int modifiers, Window grab_window); }; diff --git a/otk/otk_wrap.cc b/otk/otk_wrap.cc index 5ab614fb..0b0ebc19 100644 --- a/otk/otk_wrap.cc +++ b/otk/otk_wrap.cc @@ -5605,6 +5605,68 @@ static PyObject *_wrap_OBDisplay_ungrabButton(PyObject *self, PyObject *args) { } +static PyObject *_wrap_OBDisplay_grabKey(PyObject *self, PyObject *args) { + PyObject *resultobj; + unsigned int arg1 ; + unsigned int arg2 ; + Window arg3 ; + bool arg4 ; + int arg5 ; + int arg6 ; + bool arg7 ; + Window *argp3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj6 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OOOOiiO:OBDisplay_grabKey",&obj0,&obj1,&obj2,&obj3,&arg5,&arg6,&obj6)) goto fail; + arg1 = (unsigned int) PyInt_AsLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (unsigned int) PyInt_AsLong(obj1); + if (PyErr_Occurred()) SWIG_fail; + if ((SWIG_ConvertPtr(obj2,(void **) &argp3, SWIGTYPE_p_Window,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; + arg3 = *argp3; + arg4 = (bool) PyInt_AsLong(obj3); + if (PyErr_Occurred()) SWIG_fail; + arg7 = (bool) PyInt_AsLong(obj6); + if (PyErr_Occurred()) SWIG_fail; + otk::OBDisplay::grabKey(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_OBDisplay_ungrabKey(PyObject *self, PyObject *args) { + PyObject *resultobj; + unsigned int arg1 ; + unsigned int arg2 ; + Window arg3 ; + Window *argp3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OOO:OBDisplay_ungrabKey",&obj0,&obj1,&obj2)) goto fail; + arg1 = (unsigned int) PyInt_AsLong(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (unsigned int) PyInt_AsLong(obj1); + if (PyErr_Occurred()) SWIG_fail; + if ((SWIG_ConvertPtr(obj2,(void **) &argp3, SWIGTYPE_p_Window,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail; + arg3 = *argp3; + otk::OBDisplay::ungrabKey(arg1,arg2,arg3); + + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_delete_OBDisplay(PyObject *self, PyObject *args) { PyObject *resultobj; otk::OBDisplay *arg1 = (otk::OBDisplay *) 0 ; @@ -12946,6 +13008,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"OBDisplay_ungrab", _wrap_OBDisplay_ungrab, METH_VARARGS }, { (char *)"OBDisplay_grabButton", _wrap_OBDisplay_grabButton, METH_VARARGS }, { (char *)"OBDisplay_ungrabButton", _wrap_OBDisplay_ungrabButton, METH_VARARGS }, + { (char *)"OBDisplay_grabKey", _wrap_OBDisplay_grabKey, METH_VARARGS }, + { (char *)"OBDisplay_ungrabKey", _wrap_OBDisplay_ungrabKey, METH_VARARGS }, { (char *)"delete_OBDisplay", _wrap_delete_OBDisplay, METH_VARARGS }, { (char *)"OBDisplay_swigregister", OBDisplay_swigregister, METH_VARARGS }, { (char *)"BFont_fallbackFont", _wrap_BFont_fallbackFont, METH_VARARGS }, |
