#!/usr/bin/perl -w

# trying out the Lyx::Client class

use LyX::Client;

my $lyx = LyX::Client->new("Idea") or die "can't create lyxclient: $@";
my ($status, $data) = $lyx->command("server-get-xy");
print "$status: $data\n";
$lyx->command("buffer-begin");
($status, $data) = $lyx->command("server-get-xy");
print "$status: $data\n";
($status, $data) = $lyx->command("self-insert","Welcome to the LyX server!");
print "$status: $data\n";
$lyx->command("break-paragraph");
$lyx->command("self-insert","Type Ctrl+a to see if it works");
$lyx->command("break-paragraph");
my $event = $lyx->wait_event("C-a");
print "received $event from lyx\n";
$lyx->command("self-insert","It works!\n");

