From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Monitoring of Keyboard Buttons that are Pressed

Code and Documents

Attachment

Overview 

This VI initializes a communication with the keyboard and then monitors what buttons are pressed on the keyboard. 

 

 

Description

This example opens a reference with the keyboard and then monitor the keys pressed on the keyboard using the Acquire Input Data.vi available in the inputDevices.llb. Check Context Help for more information The indicator on the front panel then displays what buttons are being held down. it can detect when several buttons are being pressed at the same time.

 

 

Requirements

LabVIEW 2012 (or compatible)

 

 

Steps to Implement or Execute Code

1. Open and run the VI "Monitor Keyboard Presses_LV2012_NI Verified"

2.. Press any button on the keyboard

 

 

Additional Information or References

BD.PNG

 

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

Chris Van Horn
Applications Engineer

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

Comments
Xent
Member
Member
on

Hello Chris, I'm very intrested in this file but I cant use it as I'm on LabView 7.1

is there someway you can help me with this,

I would like with a keyboard button press, to activate a Boolean button on the front panel, insted of hitting it with the mouse, please email me.

JerPee
Member
Member
on

Hello Chris,

I am now using this VI, but although I'm typing on an azerty keyboard, the VI thinks that I'm typing on a qwerty. Do you have any idea how this comes?

Kind regards,

Jeroen