]>
diplodocus.org Git - xorg-xinput/blob - src/setcp.c
2 * Copyright 2007 Peter Hutterer <peter@cs.unisa.edu.au>
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
10 * The above copyright notice and this permission notice shall be included
11 * in all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
17 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19 * OTHER DEALINGS IN THE SOFTWARE.
21 * Except as contained in this notice, the name of the author shall
22 * not be used in advertising or otherwise to promote the sale, use or
23 * other dealings in this Software without prior written authorization
33 set_clientpointer(Display
* dpy
, int argc
, char** argv
, char* name
, char *desc
)
43 fprintf(stderr
, "Usage: xinput %s %s\n", name
, desc
);
49 while(*id
== '0') id
++;
51 window
= strtol(argv
[0], &dummy
, (*id
== 'x') ? 16 : 10);
53 info
= find_device_info(dpy
, argv
[1], False
);
56 fprintf(stderr
, "unable to find device %s\n", argv
[1]);
60 dev
= XOpenDevice(dpy
, info
->id
);
64 fprintf(stderr
, "Cannot open device %s.\n", argv
[1]);
66 XSetClientPointer(dpy
, window
, dev
);