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

I've a problem with Win32::Setupsup::Sendkeys :

When i want to send 'Ab' to a windows, this function send SHIFT+A and b but if CAPSLOCK is enabled, the windows receive 'aB' not cool !

I sent a mail to the module's author for his information.

My solution is test the CAPSLOCK state with GetKeyState function in user32.dll (thanks to Aldo for Win32::API), i'm writing a module (Win32::Keyboard) to do this properly...

David "Sniper" Rigaudiere

  • Comment on Win32::Setupsup::Sendkeys - Is this a bug ?

Replies are listed 'Best First'.
Re: Win32::Setupsup::Sendkeys - Is this a bug ?
by Corion (Patriarch) on May 18, 2001 at 19:26 UTC

    My guess is that this is how the module works, as it seems to be a "simple" wrapper around the Windows keyboard state API calls. Note that Windows itself and many applications were not built to be remotely driven by sending keystrokes, and be in for some interesting surprises when dealing with Windows 9x.

    I have a programm that sends keys to a Windows 9x DOS box, and if you're not really going native and talk to the keyboard driver, it's not happening under Windows 9x. Under NT, all is nice and shiny though, see my homepage if you need to deal with DOS boxes under Windows 9x.