Commit 2c52e836 authored by Peter Hutterer's avatar Peter Hutterer

Add --enable/--disable support

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarChase Douglas <chase.douglas@canonical.com>
parent bfac9503
......@@ -148,6 +148,16 @@ detected or RandR 1.2 or later is not available, a Xinerama output may be
specified as "HEAD-N", with N being the Xinerama screen number. This option
has no effect on relative devices.
.PP
.TP 8
.B --enable \fIdevice\fP
Enable the \fIdevice\fP. This call is equivalent to
.B xinput --set-prop device \fI"Device Enabled"\fP 1
.PP
.TP 8
.B --disable \fIdevice\fP
Disable the \fIdevice\fP. This call is equivalent to
.B xinput --set-prop device \fI"Device Enabled"\fP 0
.PP
\fIdevice\fP can be the device name as a string or the XID of the
device.
.PP
......
......@@ -824,3 +824,15 @@ int set_prop(Display *display, int argc, char *argv[], char *name,
return do_set_prop(display, type, format, argc, argv, name, desc);
}
int disable(Display *display, int argc, char *argv[], char *name, char *desc)
{
char *new_argv[3] = { argv[0], "Device Enabled", "0" };
return set_prop(display, 3, new_argv, name, desc);
}
int enable(Display *display, int argc, char *argv[], char *name, char *desc)
{
char *new_argv[3] = { argv[0], "Device Enabled", "1" };
return set_prop(display, 3, new_argv, name, desc);
}
......@@ -137,6 +137,16 @@ static entry drivers[] =
"<device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val> ...]",
set_prop
},
{
"disable",
"<device>",
disable,
},
{
"enable",
"<device>",
enable,
},
{NULL, NULL, NULL
}
};
......
......@@ -69,6 +69,8 @@ int set_atom_prop( Display* display, int argc, char *argv[], char *prog_name, ch
int watch_props( Display* display, int argc, char *argv[], char *prog_name, char *prog_desc);
int delete_prop( Display* display, int argc, char *argv[], char *prog_name, char *prog_desc);
int set_prop( Display* display, int argc, char *argv[], char *prog_name, char *prog_desc);
int disable( Display* display, int argc, char *argv[], char *prog_name, char *prog_desc);
int enable( Display* display, int argc, char *argv[], char *prog_name, char *prog_desc);
/* X Input 2.0 */
int create_master( Display* display, int argc, char *argv[], char *prog_name, char *prog_desc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment