我有两只老鼠,我想同时使用它们。 棘手的细节是我想要一个右手,另一个是左撇子。
答案 0 :(得分:-1)
这是twomice.pl脚本
#!/usr/bin/perl
# print "Two Mice\n";
# one left-handed and the other right-handed: cool!
# enter strings from command "xinput list"
my $leftDevice = "Mouse";
my $rightDevice = "MOUSE";
my $leftHandedOptions = "1 2 3";
my $rightHandedOptions = "3 2 1";
my $infole = `/usr/bin/xinput list | grep $leftDevice`;
my $infori = `/usr/bin/xinput list | grep $rightDevice`;
my $beginPart = "id=";
my $endPart = "\t";
$infole =~ /$beginPart(.*?)$endPart/; $infole = $1;
$infori =~ /$beginPart(.*?)$endPart/; $infori = $1;
my $commandWords = "/usr/bin/xinput set-button-map";
my $leftMouseCfg = $commandWords . " " . $infole . " " . $leftHandedOptions;
my $rightMouseCfg = $commandWords . " " . $infori . " " .
$rightHandedOptions;
#print $leftMouseCfg . "\n";
#print $rightMouseCfg ."\n";
system($leftMouseCfg);
system($rightMouseCfg);