X-Git-Url: https://diplodocus.org/git/xorg-xinput/blobdiff_plain/6ecbe3059cbc3561657841b9ee9b61e03c583eb8..2722d1a177c9482989e314e0177c782563a0b54e:/src/xinput.c diff --git a/src/xinput.c b/src/xinput.c index c8cc4f9..cc85aff 100644 --- a/src/xinput.c +++ b/src/xinput.c @@ -53,6 +53,10 @@ static entry drivers[] = " ", set_integer_feedback }, + {"get-button-map", + "", + get_button_map + }, {"set-button-map", " [ [...]]", set_button_map @@ -81,6 +85,7 @@ static entry drivers[] = "", version }, +#if HAVE_XI2 { "create-master", " [sendCore (dflt:1)] [enable (dflt:1)]", create_master @@ -101,25 +106,56 @@ static entry drivers[] = " ", set_clientpointer }, - {0, 0, 0 + { "test-xi2", + "", + test_xi2, + }, +#endif + { "list-props", + " [ ...]", + list_props + }, + { "set-int-prop", + " [ ...]", + set_int_prop + }, + { "set-float-prop", + " [ ...]", + set_float_prop + }, + { "set-atom-prop", + " [ ...]", + set_atom_prop + }, + { "watch-props", + "", + watch_props + }, + { "delete-prop", + " ", + delete_prop + }, + {NULL, NULL, NULL } }; -static Bool -is_xinput_present(Display *display) +int +xinput_version(Display *display) { XExtensionVersion *version; - Bool present; + static int vers = -1; - version = XQueryInputVersion(display, XI_2_Major, XI_2_Minor); + if (vers != -1) + return vers; + + version = XGetExtensionVersion(display, INAME); if (version && (version != (XExtensionVersion*) NoSuchExtension)) { - present = version->present; + vers = version->major_version; XFree(version); - return present; - } else { - return False; } + + return vers; } XDeviceInfo* @@ -133,7 +169,7 @@ find_device_info(Display *display, int num_devices; int len = strlen(name); Bool is_id = True; - XID id; + XID id = (XID)-1; for(loop=0; loopfunc_name, func) == 0) { int r = (*driver->func)(display, argc-2, argv+2, driver->func_name, driver->arg_desc); - XFlush(display); + XSync(display, False); return r; } driver++;