From: Kristian Høgsberg Date: Mon, 14 Jun 2010 16:53:43 +0000 (-0400) Subject: Fix X button and keycodes X-Git-Tag: 0.85.0~930 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9112b2de043209378a20203be883d85863400b6;p=platform%2Fupstream%2Fweston.git Fix X button and keycodes Not a real fix, we're just mapping them to evdev codes for now. --- diff --git a/compositor-x11.c b/compositor-x11.c index 82fecc8..3cbe0c8 100644 --- a/compositor-x11.c +++ b/compositor-x11.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -518,26 +519,22 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data) case XCB_KEY_PRESS: key_press = (xcb_key_press_event_t *) event; notify_key(c->base.input_device, - key_press->detail, 1); - - fprintf(stderr, "code %d, sequence %d\n", - key_press->detail, key_press->sequence); - + key_press->detail - 8, 1); break; case XCB_KEY_RELEASE: key_press = (xcb_key_press_event_t *) event; notify_key(c->base.input_device, - key_press->detail, 0); + key_press->detail - 8, 0); break; case XCB_BUTTON_PRESS: button_press = (xcb_button_press_event_t *) event; notify_button(c->base.input_device, - button_press->detail, 1); + button_press->detail + BTN_LEFT - 1, 1); break; case XCB_BUTTON_RELEASE: button_press = (xcb_button_press_event_t *) event; notify_button(c->base.input_device, - button_press->detail, 0); + button_press->detail + BTN_LEFT - 1, 0); break; case XCB_MOTION_NOTIFY: diff --git a/compositor.c b/compositor.c index fad9b7b..310ee02 100644 --- a/compositor.c +++ b/compositor.c @@ -656,8 +656,6 @@ notify_button(struct wlsc_input_device *device, struct wlsc_compositor *compositor = device->ec; int32_t sx, sy; - fprintf(stderr, "notify button: button %d, state %d\n", button, state); - surface = pick_surface(device, &sx, &sy); if (surface) { if (state) {