If you want to see the strokes to which xscribble is trained, run the
following program with stdin redirected from the appropriate
classifier file as found in the xscribble source's classifier directory.
While you look at these strokes, remember that the recognizer only
recognizes lower-case letters. An upper-case letter is
meta-information:
case 'L': /* caps lock */
case 'N': /* numlock */
case 'P': /* usually puncshift, but we'll make it CTRL */
case 'S': /* shift */
case 'A': keysym = XK_space;
case 'B': keysym = XK_BackSpace;
case 'R': keysym = XK_Return;
case '.': /* puncshift */
There is no stroke for Escape; vi users lose!
There is no stroke for Meta-; emacs users lose!
#!/usr/bin/perl
use Tk;
$radius = 3;
sub nextone {
$canvas->delete('all');
if ($n == $lines) {
$_ = <>;
exit unless $_;
($lines, $glyph) = split;
$n = 0;
}
$n++;
$label->configure(text => "'$glyph', $n of $lines");
$_ = <>;
@a = split;
$_ = shift(@a);
$ox = shift @a;
$oy = shift @a;
$canvas->create('oval', $ox - $radius, $oy - $radius, $ox + $radius, $oy + $radius, fill => 'black');
while(@a) {
$x = shift @a;
$y = shift @a;
$canvas ->create(line, $ox, $oy, $x, $y);
$ox = $x;
$oy = $y;
}
}
$top = MainWindow->new();
$canvas = $top->Canvas(width => 256, height => 256)->pack();
$button = $top->Button(text => 'Next', command => \&nextone)->pack();
$label = $top->Label(text => '')->pack();;
while(<>) {
last if /^ /;
}
while(<>) {
last if /^\d/;
}
($lines, $glyph) = split;
$n = 0;
nextone();
MainLoop();
Received on Wed Aug 9 13:57:03 2000
This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:42:16 EDT