+ OBWidget *w = dynamic_cast<OBWidget*>
+ (Openbox::instance->findHandler(e.window));
+
+ // run the LEAVE python hook
+ doCallback(Action_LeaveWindow, e.window,
+ (OBWidget::WidgetType)(w ? w->type():-1), e.state, 0, 0, 0, 0);
+}
+
+
+void OBActions::keyPressHandler(const XKeyEvent &e)
+{
+// OBWidget *w = dynamic_cast<OBWidget*>
+// (Openbox::instance->findHandler(e.window));
+
+ Openbox::instance->bindings()->fire(e.state, e.keycode, e.time);
+}
+
+
+void OBActions::motionHandler(const XMotionEvent &e)
+{
+ if (!e.same_screen) return; // this just gets stupid
+
+ int x_root = e.x_root, y_root = e.y_root;
+
+ // compress changes to a window into a single change
+ XEvent ce;
+ while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) {
+ if (ce.xmotion.window != e.window) {
+ XPutBackEvent(otk::OBDisplay::display, &ce);
+ break;
+ } else {
+ x_root = e.x_root;
+ y_root = e.y_root;
+ }
+ }
+
+
+ OBWidget *w = dynamic_cast<OBWidget*>
+ (Openbox::instance->findHandler(e.window));
+
+ // XXX: i can envision all sorts of crazy shit with this.. gestures, etc
+ // maybe that should all be done via python tho.. (or radial menus!)
+ // run the simple MOTION python hook for now...
+ doCallback(Action_MouseMotion, e.window,
+ (OBWidget::WidgetType)(w ? w->type():-1),
+ e.state, (unsigned)-1, x_root, y_root, e.time);