1: #include <X/mit-copyright.h> 2: 3: /* $Header: XQueryButtons.c,v 10.4 86/02/01 15:38:44 tony Rel $ */ 4: /* Copyright Massachusetts Institute of Technology 1985 */ 5: 6: #include "XlibInternal.h" 7: Status XQueryMouseButtons (w, x, y, subw, state) 8: Window w; 9: Window *subw; 10: int *x, *y; 11: short *state; 12: { 13: register Display *dpy; 14: register XReq *req; 15: XRep rep; 16: 17: GetReq(X_QueryMouse, w); 18: if (!_XReply(dpy, &rep)) 19: return (0); 20: *x = rep.param.s[2]; 21: *y = rep.param.s[3]; 22: *subw = rep.param.l[0]; 23: *state = rep.param.s[4]; 24: return (1); 25: }