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)
More Related Contents:
- a pythonic way of doubling consecutive binary bits [closed]
- How to make a list of variables
- How to display position of an element in an array? [closed]
- User input integer list [duplicate]
- How do I type hint a method with the type of the enclosing class?
- Replace values in a pandas series via dictionary efficiently
- How to make Firefox headless programmatically in Selenium with Python?
- Saving and loading multiple objects in pickle file?
- How do I .decode(‘string-escape’) in Python 3?
- Subprocess.Popen: cloning stdout and stderr both to terminal and variables
- Get defining class of unbound method object in Python 3
- How can I intercept calls to python’s “magic” methods in new style classes?
- How to use a return statement in a for loop?
- Backporting Python 3 open(encoding=”utf-8″) to Python 2
- Conda command is not recognized on Windows 10
- Difference between static STATIC_URL and STATIC_ROOT on Django
- Accessing attributes on literals work on all types, but not `int`; why? [duplicate]
- TypeError: got multiple values for argument
- how to know pygame.Rect’s side that collide to other Rect?
- How to print multiple lines of text with Python
- Find position of another anchor than the anchor already used
- Tkinter window says (not responding) but code is running
- How do I change the background of a Frame in Tkinter?
- ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
- How to change ForeignKey display text in the Django Admin?
- How is super() in Python 3 implemented?
- Python OpenCV multiprocessing cv2.VideoCapture mp4
- pandas.read_csv from string or package data
- How to pad a string with leading zeros in Python 3 [duplicate]
- pandas scatter plotting datetime