Good Monks, I can't help thinking that the solution to this problem must be well known but while I've studied the Perl/Tk book and searched the Web I can't get this working. I'm writing a program with Perl/Tk where the relevant bits are like this:
my $mw = MainWindow->new(); $mw->protocol(WM_DELETE_WINDOW=>\&exitfile); my $menuframe = $mw->Frame(-bd=>4, -relief=>'groove')->pack(-side=>'to +p', -fill=>'x', -expand=>'x');<br> my $canvasframe = $mw->Frame(-bd=>4, -relief=>'groove')->pack(-side=>' +bottom', -fill=>'both', -expand=>'both');
...
my $canvas1 = $canvasframe->Scrolled('Canvas', -width=>'20i', -height= +>'10i', -background=>$papercolour)->pack(-fill=>'both', -expand=>'bot +h'); $canvasframe->focus; $mw->bind($keypress=>\&$action); MainLoop;
where the keypresses and actions are read from a file (you can view the whole source of the main module at http://sandyfleming.org/swposter_0_3.txt if you want). This works excellently for all keys except the Tab key. Pressing the tab key causes the focus to change so that from then on keys such as the arrow keys move the canvas about instead of doing the action I've bound to them. What am I doing wrong?

In reply to Tab Key in Perl/Tk by Juthware

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.