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

I am sending values to a field of a forground dialog box which is case sensitive using Win32::GuiTest::SendKeys method as follows:

SendKeys("%Ppasword{ENTER}");

If the caps lock is activated the value is not validated properly.

Even {CAPS} pattern allow me to activate/deactivate the Caps lock it does not help me since I don't know the current keyboard status.

I am struggling with the codes here to use Win32::API module to serve this purpose.

Please suggest me a good solution if you have...-SB

edited by ybiC: change conventional <a href=...> URL to perlmonks style [id://...] to not logout monks with cookie set to particular domain

Replies are listed 'Best First'.
Re: Caps Lock problem @ SendKeys method in Win32::GuiTest module
by Mr. Muskrat (Canon) on Aug 15, 2003 at 16:28 UTC

    <shameless plug>You might have better luck getting the status with Win32::KeyState.</shameless plug>

    use Win32::GuiTest qw(SendKeys); use Win32::KeyState qw(:get); SendKeys("{CAPS}") if GetCapsLock();

    Note: On Win9x systems, you cannot use SendKeys to turn on or off NumLock and you might have problems with ScrollLock and CapsLock.

      Yeeh! Even it shameless to use ;-), perfectly matches my requirements, Thanks - SB.