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