This is driving me crazy. I have a text field that I have absolutely no interest in ever entering an actual tab character into. I want Tab to shift the focus to the next widget, but I cannot get this to work. I have the following code:
my $t1 = $mw->Text( -background=>"navy", -foreground=>"white", -height=>35, -width=>80, -wrap=>"word", -selectbackground=>"blueviolet" ); my $e2 = $mw->Entry( -background=>"navy", -foreground=>"white", -width=>80, -textvariable=>\$description, -selectbackground=>"blueviolet" ); $t1->bind("<Tab>", sub { $e2->focus });

Now I have replaced Tab with Ctrl-q, and then when I Ctrl-q I get a control character printed, and the desired focus shift. But when I go back to Tab, I get a tab, and no focus shift. What do I have to do to rebind Tab to my wishes? If it's not possible to rebind Tab, how do I bind a character without the character printing in my Text field?

--
Believe nothing, no matter where you read it, or who said it - even if I have said it - unless it agrees with your own reason and your own common sense.
(Buddha)

In reply to re-binding Tab in a TK Text field by wolfger

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.