- tap_time = 0;
-
- if (xsft->event_cb && xwindow) {
- double s = [self hackedContentScaleFactor];
- XEvent xe;
- memset (&xe, 0, sizeof(xe));
- int i = 0;
- // #### 'frame' here or 'bounds'?
- int w = s * [self frame].size.width;
- int h = s * [self frame].size.height;
- for (UITouch *touch in touches) {
- CGPoint p = [touch locationInView:self];
- xe.xany.type = ButtonPress;
- xe.xbutton.button = i + 1;
- xe.xbutton.button = i + 1;
- xe.xbutton.x = s * p.x;
- xe.xbutton.y = s * p.y;
- [self rotateMouse: rot_current_angle
- x: &xe.xbutton.x y: &xe.xbutton.y w: w h: h];
- jwxyz_mouse_moved (xdpy, xwindow, xe.xbutton.x, xe.xbutton.y);
-
- // Ignore return code: don't care whether the hack handled it.
- xsft->event_cb (xdpy, xwindow, xdata, &xe);
-
- // Remember when/where this was, to determine tap versus drag or hold.
- tap_time = double_time();
- tap_point = p;
-
- i++;
- break; // No pinches: only look at the first touch.
- }
- }
+ XEvent xe;
+ memset (&xe, 0, sizeof(xe));
+ xe.xkey.keycode = ' ';
+ xe.xany.type = KeyPress;
+ BOOL ok1 = [self sendEvent: &xe];
+ xe.xany.type = KeyRelease;
+ BOOL ok2 = [self sendEvent: &xe];
+ if (!(ok1 || ok2))
+ [self beep];