X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=premotedroid-server.pl;h=0d7c6b0d4c1120f230842aefb5911f0bbfd4257b;hb=84af4ebaf2cd7af727a304463504e136bbbbf1e9;hp=08131924d4da7da1fee738b4e6698fd80c14d4e1;hpb=4eab6d0c817dd5362ad2f9c469ddcbafa33f185d;p=premotedroid-server-perl.git diff --git a/premotedroid-server.pl b/premotedroid-server.pl index 0813192..0d7c6b0 100755 --- a/premotedroid-server.pl +++ b/premotedroid-server.pl @@ -43,10 +43,22 @@ while ( my $client = $sock->accept() ) { while ( read $client, my $command, 1 ) { $command = ord $command; warn "# command: $command\n"; - if ( $command == AUTHENTIFICATION ) { + if ( $command == MOUSE_MOVE ) { + read $client, my $move, 4; + my ( $x, $y ) = unpack 's>s>', $move; # big-endian 16 bit + warn "MOVE $x $y\n"; + } elsif ( $command == MOUSE_CLICK ) { + read $client, my $b, 2; + my ( $button, $state ) = unpack 'cc', $b; + warn "MOUSE_CLICK $button $state\n"; + } elsif ( $command == MOUSE_WHEEL ) { + read $client, my $amount, 1; + $amount = unpack 'c', $amount; + warn "MOUSE_WHEEL $amount\n"; + } elsif ( $command == AUTHENTIFICATION ) { my $auth = readUTF $client; warn "AUTHENTIFICATION [$auth]\n"; - + print $client pack 'cc', AUTHENTIFICATION_RESPONSE, 1; # FIXME anything goes } else { die "UNSUPPORTED"; }