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

hi. i've got a funky little win32::gui program that has a little settings window. the word has come from on high that there needs to be a keyboard shortcut for a few buttons. that seems easy enough with the win32::gui::acceleratortable module except that it isn't working yet. i've also played around with iskeypressed in win32::guitest having the window drawn inside a loop with win32::gui::doevents to make it run smoothly. that, however, causes major headaches. has anyone managed to get accelerators working in win32::gui or know of a workaround to get it working?

thanx in advance

Title edit by tye

Replies are listed 'Best First'.
Re: accelerators
by Flame (Deacon) on May 21, 2002 at 04:32 UTC
    As far as anyone knows, accelerators used to work in a much older version of Win32::GUI, however they have not worked in the past year or so. It's one of those 'planned' things now.

    For more information, check out their SourceForge page.



    "Weird things happen, get used to it."

    Flame ~ Lead Programmer: GMS

Re: Keyboard accelerators with Win32::GUI
by jplindstrom (Monsignor) on May 21, 2002 at 16:56 UTC
    A workaround (from a previous mail to the win32-gui-users mailing list):

    In The GUI Loft, I use a Timer to poll for keyboard activity. Download the source at

    http://www.bahnhof.se/~johanl/perl/Loft/

    and look at the sub ::timKey_Timer (in lib\TGL\WindowDesign.pm). It uses the sub Win32::GUI::AdHoc::GetKeyboardState (in PPM\AdHoc\lib\Win32\GUI\AdHoc.pm).

    It's not an elegant solution, but it works almost as desired.

    Maybe you can do something similar until the Accelerator support is fixed?

    /J