From 54136f2c2a37e92a5b5e49035d27ce6728e12e3a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 10 Mar 2009 13:23:53 +1000 Subject: [PATCH] Change event registration a bit, using SetBit instead. --- src/test_xi2.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test_xi2.c b/src/test_xi2.c index c729125..4193c09 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -29,6 +29,7 @@ extern void print_classes_xi2(Display*, XIAnyClassInfo **classes, int num_classes); #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) +#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) static Window create_win(Display *dpy) { @@ -130,8 +131,13 @@ test_xi2(Display *display, mask.deviceid = AllDevices; mask.mask_len = 2; mask.mask = calloc(2, sizeof(char)); - mask.mask[0] = XI_ButtonPressMask | XI_ButtonReleaseMask | XI_MotionMask | - XI_KeyPressMask | XI_KeyReleaseMask | XI_DeviceChangedMask; + SetBit(mask.mask, XI_ButtonPress); + SetBit(mask.mask, XI_ButtonRelease); + SetBit(mask.mask, XI_Motion); + SetBit(mask.mask, XI_KeyPress); + SetBit(mask.mask, XI_KeyPress); + SetBit(mask.mask, XI_DeviceChanged); + SetBit(mask.mask, XI_HierarchyChanged); XISelectEvent(display, win, &mask, 1); free(mask.mask); -- 2.56.0