muppet (the Gtk2 wizard) posted a little alphabet trainer (for his toddlers) on the gtk2-perl maillist. With a little modification, it can be used as a keyboard trainer. It uses flite

Also good for entry level IT workers. :-)

#!/usr/bin/perl -w # muppet # This simple bit of code has helped my toddlers learn letters and # numbers for quite some time. I thought i should share it, if for # nothing else than the line where i set the font size. :-) # zentara # Version 2 ... the keyboard trainer....free for all who purchased # Version 1 within the last year :-) use strict; use Gtk2 -init; my $window = Gtk2::Window->new; $window->set_size_request(800,300); $window->set_position('center'); my $label = Gtk2::Label->new ("W"); my $font_desc = Gtk2::Pango::FontDescription->from_string ("Sans Bold" +); $font_desc->set_size (100000); $label->modify_font ($font_desc); $window->add ($label); $window->signal_connect (key_release_event => \&keyrelease); $window->signal_connect (destroy => sub { Gtk2->main_quit }); $window->show_all; Gtk2->main; sub keyrelease { my ($widget, $event) = @_; my $key = Gtk2::Gdk->keyval_name ($event->keyval); if( $key =~ /^(Alt|Multi|Control|Shift)/ ){ return } $key =~ tr/_/ /; my $ukey = uc($key); $label->set_text ($ukey); #added by zentara Gtk2->main_iteration while Gtk2->events_pending; system('flite', '-t', "$key"); } __END__

In reply to Children's Gtk keyboard trainer with audio by zentara

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.