Index: /platform/psp/pspslidepanel/server-pp.pl
===================================================================
--- /platform/psp/pspslidepanel/server-pp.pl (revision 2922)
+++ /platform/psp/pspslidepanel/server-pp.pl (revision 2922)
@@ -0,0 +1,118 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use Pod::Usage;
+
+{
+    package Server;
+    use POE qw/Component::Server::HTTP/;
+    use base qw/Class::Accessor::Fast/;
+
+    use Win32::OLE;
+
+    sub new {
+        my $self = shift->SUPER::new( @_ > 1 ? {@_} : $_[0] );
+    }
+
+    sub run {
+        my $self = shift;
+
+        POE::Session->create(
+            object_states => [
+                $self => [qw/_start/],
+            ],
+        );
+        POE::Kernel->run;
+    }
+
+    sub _start {
+        my ($self, $kernel) = @_[OBJECT, KERNEL];
+
+        my $bind = sub {
+            my ($sub) = @_;
+
+            sub {
+                $self->$sub(@_);
+            };
+        };
+
+        $kernel->alias_set('main');
+        POE::Component::Server::HTTP->new(
+            Port           => $self->{port},
+            ContentHandler => {
+                '/cmd/' => $bind->('handle_key'),
+                '/swf/' => $bind->('handle_swf'),
+                '/'     => $bind->('handle_root'),
+            },
+        );
+    }
+
+    sub handle_root {
+        my ($self, $req, $res) = @_;
+        $res->code(200);
+
+        $res->content_type('text/html');
+        $res->content(<<"__HTML__");
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>PSPスライド操作パネル</title>
+</head>
+<body style="margin:0;padding:0">
+<object data="/swf/?total=$self->{total}&max=$self->{max}" width="480" height="272" type="application/x-shockwave-flash"></object>
+</body>
+</html>
+__HTML__
+    }
+
+    sub handle_swf {
+        my ($self, $req, $res) = @_;
+        $res->code(200);
+
+        open my $fh, '<', 'psp.swf';
+        my $swf = do { local $/; <$fh> };
+        close $fh;
+
+        $res->content_type('application/x-shockwave-flash');
+        $res->content($swf);
+    }
+
+    sub handle_key {
+        my ($self, $req, $res) = @_;
+
+        my $app = Win32::OLE->GetActiveObject('PowerPoint.Application');
+        unless (defined $app) {
+            $app = Win32::OLE->new('PowerPoint.Application')
+                or die Win32::OLE->LastError;
+        }
+
+        my ($key) = $req->uri->path =~ m!cmd/([^/]+)!;
+        my $view = $app->ActivePresentation->SlideShowSettings->Run->View or die Win32::OLE->LastError;
+
+        if ($key eq 'left') {
+            $view->Previous;
+        }
+        elsif ($key eq 'up') {
+        }
+        elsif ($key eq 'right') {
+            $view->Next;
+        }
+        elsif ($key eq 'down') {
+        }
+
+        $res->code(200);
+        $res->content( $view->CurrentShowPosition );
+    }
+}
+
+GetOptions(
+    \my %opt,
+    qw/help num=s sec=s port=s/
+);
+pod2usage(0) if $opt{help};
+
+my $server = new Server->new( port => $opt{port} || 80, max => $opt{num} || 10, total => $opt{sec} || 300 );
+$server->run;
Index: /atform/psp/pspslidepanel/ppserver.pl
===================================================================
--- /platform/psp/pspslidepanel/ppserver.pl (revision 342)
+++  (revision )
@@ -1,87 +1,0 @@
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-
-{
-    package Server;
-    use POE qw/Component::Server::HTTP/;
-    use base qw/Class::Accessor::Fast/;
-
-    use Win32::OLE;
-
-    sub new {
-        my $self = shift->SUPER::new( @_ > 1 ? {@_} : $_[0] );
-    }
-
-    sub run {
-        my $self = shift;
-
-        POE::Session->create(
-            object_states => [
-                $self => [qw/_start/],
-            ],
-        );
-        POE::Kernel->run;
-    }
-
-    sub _start {
-        my ($self, $kernel) = @_[OBJECT, KERNEL];
-
-        $kernel->alias_set('main');
-        POE::Component::Server::HTTP->new(
-            Port           => $self->{port},
-            ContentHandler => {
-                '/key/' => \&handle_key,
-                '/'     => \&handle_root,
-            },
-        );
-    }
-
-    sub handle_root {
-        my ($req, $res) = @_;
-        $res->code(200);
-
-        open my $fh, '<', 'psp.swf';
-        my $swf = do { local $/; <$fh> };
-        close $fh;
-
-        $res->content_type('application/x-shockwave-flash');
-        $res->content($swf);
-        return 200;
-    }
-
-    sub handle_key {
-        my ($req, $res) = @_;
-        $res->code(200);
-
-        my $app = Win32::OLE->GetActiveObject('PowerPoint.Application');
-        unless (defined $app) {
-            $app = Win32::OLE->new('PowerPoint.Application')
-                or die Win32::OLE->LastError;
-        }
-
-        my ($key) = $req->uri =~ m!key/(\d+)!;
-        my $view = $app->ActivePresentation->SlideShowSettings->Run->View or die Win32::OLE->LastError;
-
-        if ($key eq '37') {
-            $view->Previous;
-        }
-        elsif ($key eq '38') {
-        }
-        elsif ($key eq '39') {
-            $view->Next;
-        }
-        elsif ($key eq '40') {
-        }
-
-        $res->code(200);
-        $res->content( $view->CurrentShowPosition );
-    }
-}
-
-my $server = new Server->new( port => 80 );
-$server->run;
-
-
-
