send mouse wheel events to xdotool
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 19 Sep 2010 21:11:40 +0000 (23:11 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 19 Sep 2010 21:11:40 +0000 (23:11 +0200)
premotedroid-server.pl

index 470b069..d4f2169 100755 (executable)
@@ -65,6 +65,7 @@ while ( my $client = $sock->accept() ) {
                        read $client, my $amount, 1;
                        $amount = unpack 'c', $amount;
                        warn "MOUSE_WHEEL $amount\n";
+                       print $xdo 'click ' . ( $amount > 0 ? 4 : 5 ) . "\n" foreach ( 1 .. abs($amount) );
                } elsif ( $command == AUTHENTIFICATION ) {
                        my $auth = readUTF $client;
                        warn "AUTHENTIFICATION [$auth]\n";