Example Code

Determining the Coordinates of the Mouse with an Event Structure

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

Monitoring the position of the mouse based on events.

 

Description

Event are actions caused by the user. LabVIEW can acknowledge several actions like a mause event, pressing keys on the keyboard, and so on. In this code, we are taking advantage of this functionality to calculate the coordinates of the mouse within the front panel.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Open the "Mouse Position with Event Structure LV2012 - NIVerified.vi".
2. Select the Run button.
3. Move the mouse throughout the entire front panel frame.

 

Additional Information or References

Capture.PNG

 

Chris Van Horn
Applications Engineer

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