+
+void grab_button(guint button, guint state, Window win, guint mask,
+ int pointer_mode)
+{
+ guint i;
+
+ for (i = 0; i < MASK_LIST_SIZE; ++i)
+ XGrabButton(ob_display, button, state | mask_list[i], win, FALSE, mask,
+ pointer_mode, GrabModeAsync, None, None);
+}
+
+void ungrab_button(guint button, guint state, Window win)
+{
+ guint i;
+
+ for (i = 0; i < MASK_LIST_SIZE; ++i)
+ XUngrabButton(ob_display, button, state | mask_list[i], win);
+}
+
+void grab_key(guint keycode, guint state, int keyboard_mode)
+{
+ guint i;
+
+ for (i = 0; i < MASK_LIST_SIZE; ++i)
+ XGrabKey(ob_display, keycode, state | mask_list[i], ob_root, FALSE,
+ GrabModeAsync, keyboard_mode);
+}
+
+void ungrab_all_keys()
+{
+ XUngrabKey(ob_display, AnyKey, AnyModifier, ob_root);
+}