Re: perl/tk changes for sun keyboard 10-key pad
Slaven Rezic <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
"Troy.A Johnson" <[email protected]> writes: > Hello Perl/Tk People! > > I asked some questions about this some months ago and I received > many helpful responses. Thank you very much! > > We finally got our problems squared away (got the applications > working the way they used to), but the solution is probably not > a good, acceptable to all Tk-ers kind of solution. Regardless, > I wanted to share what we did in case it is of interest to others > (Sun users or not). Also, to put it out there in case some of the > modifications are "bad" and could cause us problems (though > I do know we will probably have to patch next time we update > Tk, we usually stay at given rev for years). > > The changes are here: > > http://troy.jdmz.net/perltk/ > It seems that Sun is quite different than "normal" Unix PCs (or is it XFree86 that makes the difference?). On my machine (FreeBSD 4.x, i386, old XFree86 3.x.x, Tk 804.027) the numeric keypad works as expected if Num_Lock is on. Cursor keys (if Num_Lock is off) do not work in Tk's entry, but they send the special key events KP_Left, KP_Right etc. The following simple lines: use Tk; $top = new MainWindow; for my $key (qw(Left Right Home End Delete Insert)) { $top->bind("Tk::Entry", "<KP_$key>" => sub { $_[0]->eventGenerate("<$key>") }); } $top->Entry->pack; MainLoop; __END__ make the cursor keys work, but unfortunately the 1, 4, 7 keys do not work anymore?! Seems like a Tk bug to me... Regards, Slaven -- Slaven Rezic - slaven <at> rezic <dot> de tkrevdiff - graphical display of diffs between revisions (RCS, CVS or SVN) http://ptktools.sourceforge.net/#tkrevdiff -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to [email protected]