+void prompt_key_event(ObPrompt *self, XEvent *e)
+{
+ gboolean shift;
+ guint shift_mask;
+
+ if (e->type != KeyPress) return;
+
+ g_print("key 0x%x 0x%x\n", e->xkey.keycode, ob_keycode(OB_KEY_TAB));
+
+ shift_mask = obt_keyboard_modkey_to_modmask(OBT_KEYBOARD_MODKEY_SHIFT);
+ shift = !!(e->xkey.state & shift_mask);
+
+ /* only accept shift */
+ if (e->xkey.state != 0 && e->xkey.state != shift_mask)
+ return;
+
+ if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE))
+ prompt_hide(self);
+ else if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN)) {
+ /* XXX run stuff */
+ prompt_hide(self);
+ }
+ else if (e->xkey.keycode == ob_keycode(OB_KEY_TAB)) {
+ guint i;
+ ObPromptElement *oldfocus;
+
+ oldfocus = self->focus;
+
+ for (i = 0; i < self->n_buttons; ++i)
+ if (self->focus == &self->button[i]) break;
+ i += (shift ? -1 : 1);
+ if (i < 0) i = self->n_buttons - 1;
+ else if (i >= self->n_buttons) i = 0;
+ self->focus = &self->button[i];
+
+ if (oldfocus != self->focus) render_button(self, oldfocus);
+ render_button(self, self->focus);
+ }
+}
+
+void prompt_mouse_event(ObPrompt *self, XEvent *e)