NAME

Win32::KeyState - Get the status of "virtual" keys

SYNOPSIS

use Win32::KeyState qw(:get);

print 'CapsLock is ', GetCapsLock() ? 'On' : 'Off', "\n";
print "Shift key is depressed\n" if (GetKeyState(0x10) & 1);

DESCRIPTION

These functions utilizes Win32::API to allow one to get the status of the CapsLock, NumLock and ScrollLock keys.

FUNCTIONS

GetKeyState

Returns the raw key state information. To determine the boolean state, take the return value and perform a bitwise and with 1.

GetCapsLock

Returns true if CapsLock is on.

GetNumLock

Returns true if NumLock is on.

GetScrollLock

Returns true if ScrollLock is on.

SetCapsLock

Sets (or unsets) CapsLocks. (Not yet implemented)

SetNumLock

Sets (or unsets) NumLock. (Not yet implemented)

SetScrollLock

Sets (or unsets) ScrollLock. (Not yet implemented)

TODO

Set*Lock

I would love to be able to set the status of CapsLock, NumLock & ScrollLock with Perl. I have started reading the M$ documentation that describes how to do this. This will be implemented if I figure it out. ;-)

CREDITS

dada <dada@perl.it> for creating Win32::API

SEE ALSO

perl, Win32, Win32::API

AUTHOR

Matthew Musgrove <muskrat@mindless.com>