Forum Discussion
HKosova
SmartBear Alumni (Retired)
What makes you think TestComplete is not turning off Caps Lock? What actions is your test trying to perform, and what exactly does not work as expected?
Please provide more details - script code or keyboard test screenshots, error text from the test log, and so on.
PeterMitcham
9 years agoOccasional Contributor
If bl is true then caps lock is on. the Keybd event will then turn it off, and the last call tests the keystate again to confirm its off.
bl = cBool(Win32API.GetKeyState(VK_CAPITAL))
If bl then
Call Win32API.keybd_event(VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYDOWN, 0)
Call Win32API.keybd_event(VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End if
bl = cBool(Win32API.GetKeyState(VK_CAPITAL))
Related Content
- 5 years agowdbian