I've been searching for a way to identify the status of the CAPS LOCK in Python 3 and the only thing I've found applicable was a post here in Stack Overflow answered by Abhijit stating:
You can use ctypes to load user32.dll and then call GetKeyState with nVirtKey = VK_CAPITAL (0x14)
def get_capslock_state(): import ctypes hllDll = ctypes.WinDLL ("User32.dll") VK_CAPITAL = 0x14 return hllDll.GetKeyState(VK_CAPITAL)
I've applied this to my script, but the value returned is not the anticipated 1/0, but a long 9 number sequence which never repeats. I'm not certain how to use this value to return the 1/0, T/F, or any true value to test against.
Any ideas, either based on Abhijit's comment or another method that works in Python 3? Your help is greatly appreciated, as this is driving me nuts.