# Script for Caps Lock state

**URL:** <https://forum.inductiveautomation.com/t/script-for-caps-lock-state/11649>\
**Category:** Ignition\
**Created:** [May 11, 2016, 7:44pm UTC](https://forum.inductiveautomation.com/t/script-for-caps-lock-state/11649 "2016-05-11T19:44:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raymond1982](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/raymond1982/32/6490_2.png) [@raymond1982](https://forum.inductiveautomation.com/u/raymond1982)\
**Post date:** [May 11, 2016, 7:44pm UTC](https://forum.inductiveautomation.com/t/script-for-caps-lock-state/11649/1 "2016-05-11T19:44:09Z")

</div>

I’m attempting to get a script to read the status of the caps lock LED. The module that I need to import is ctypes however the function I need in cytpes is windll. It apparently doesn’t exist in the jython distribution.  
Has anyone solved this from a different angle? Any help is appreciated.

Ignition 7.8  
Win 7, win10

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [May 11, 2016, 8:37pm UTC](https://forum.inductiveautomation.com/t/script-for-caps-lock-state/11649/2 "2016-05-11T20:37:13Z")

</div>

```auto
import java.awt.Toolkit
import java.awt.event.KeyEvent
isOn = java.awt.Toolkit.getDefaultToolkit().getLockingKeyState(java.awt.event.KeyEvent.VK_CAPS_LOCK)
print isOn
```

---

<div class="post-metadata">

**Author:** ![dsui](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dsui](https://forum.inductiveautomation.com/u/dsui)\
**Post date:** [December 12, 2018, 3:38pm UTC](https://forum.inductiveautomation.com/t/script-for-caps-lock-state/11649/3 "2018-12-12T15:38:16Z")

</div>

Would there be a way to bind the isOn to an expression tag? (enabled property of a text display label)

Ignition 7.9  
Win 10

---

<div class="post-metadata">

**Author:** ![dsui](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dsui](https://forum.inductiveautomation.com/u/dsui)\
**Post date:** [December 12, 2018, 3:52pm UTC](https://forum.inductiveautomation.com/t/script-for-caps-lock-state/11649/4 "2018-12-12T15:52:52Z")

</div>

Never mind. I just put the above script into a Client Event Script. In this case, the script would write to a memory tag instead of printing to console. From here, I could bind the tag to the enabled property.
