Alex Rivera | Logout

Change keyboard locks in Python

Asked 2009-05-12T19:19:37.190
23

Is there any way, in Python, to programmatically change the CAPS LOCK/NUM LOCK/SCROLL LOCK states?

This isn't really a joke question - more like a real question for a joke program. I intend to use it for making the lights do funny things...

Edit
Report

1 Answer

16

If you're using windows you can use SendKeys for this I believe.

http://www.rutherfurd.net/python/sendkeys

import SendKeys

SendKeys.SendKeys("""
{CAPSLOCK}
{SCROLLOCK}
{NUMLOCK}
""")
answered 2009-05-12T19:28:17.113

Your Answer