water has asked for the wisdom of the Perl Monks concerning the following question:

Hi -- I'm a TK newbie, working on Win XP Activestate Perl 5.8.2 and Tk 800.000.

Is there a way to have accelerators for menubars that dont require the ALT key?

For example, I'd like the user to be able to type 'F' to invoke a top level Foo Menu (menubar), rather than ALT-F.

Thanks!

water

Replies are listed 'Best First'.
Re: Tk accelerators
by davidrw (Prior) on Jun 20, 2005 at 20:48 UTC
    From taking a look at Tk::bind, it looks like you can bind events to the toplevel window.. in this case you're probably looking for the KeyPress or KeyRelease events .. Your callback would then just check if it was 'F' that was pressed, and then just invoke your Tk::Menu or Tk::Menu::Item object.