diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-10 13:23:53 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-21 22:18:42 +1000 |
commit | 54136f2c2a37e92a5b5e49035d27ce6728e12e3a (patch) | |
tree | 99aa23d0935605a7bcd00cb7539d9f42de8bbc72 | |
parent | 959faacf2e125312b3ff0cc71f4e0b4ee059757f (diff) |
Change event registration a bit, using SetBit instead.
-rw-r--r-- | src/test_xi2.c | 10 |
1 files 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); |