]>
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
)
42 fprintf(stderr
, "Usage: xinput %s %s\n", name
, desc
);
48 while(*id
== '0') id
++;
50 window
= strtol(argv
[0], &dummy
, (*id
== 'x') ? 16 : 10);
52 info
= xi2_find_device_info(dpy
, argv
[1]);
55 fprintf(stderr
, "unable to find device %s\n", argv
[1]);
59 XISetClientPointer(dpy
, window
, info
->deviceid
);