+ grabKeys(true);
+}
+
+
+void OBBindings::grabKeys(bool grab)
+{
+ for (int i = 0; i < Openbox::instance->screenCount(); ++i) {
+ Window root = otk::OBDisplay::screenInfo(i)->rootWindow();
+
+ KeyBindingTree *p = _curpos->first_child;
+ while (p) {
+ if (grab) {
+ otk::OBDisplay::grabKey(p->binding.key, p->binding.modifiers,
+ root, false, GrabModeAsync, GrabModeAsync,
+ false);
+ }
+ else
+ otk::OBDisplay::ungrabKey(p->binding.key, p->binding.modifiers,
+ root);
+ p = p->next_sibling;
+ }
+
+ if (grab)
+ otk::OBDisplay::grabKey(_resetkey.key, _resetkey.modifiers,
+ root, true, GrabModeAsync, GrabModeAsync,
+ false);
+ else
+ otk::OBDisplay::ungrabKey(_resetkey.key, _resetkey.modifiers,
+ root);