Example Code

Get Caps Lock Key State Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

The Get Caps Lock Key State VI returns the current state of the Caps Lock key.

 

Description

The VI calls the Windows API (User32.dll) and uses the GetKeyState function to get the current key state. The VI outputs the current key state as a numeric and also as a descriptive text string.

 

Requirements

  • LabVIEW 2012( (or compatible)

Steps to Implement or Execute Code

  1. Change the state of Capslock  key
  2. Run the VI 

 

Additional Information or References

Front Panel

FP.JPG

VI snippet

BD.png

 **This document has been updated to meet the current required format for the NI Code Exchange.** 

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.