Example Code

Keyboard Controlled Cursor 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

This example was written to show how event structures and property nodes can work together to move a cursor on a graph by using keystrokes.

 

Description 

In the attached example, certain letters on the keyboard (A, D, W, and X) are programmed to move the cursor in certain directions by using event structures. Other properties are also made available for the user to modify during run-time. Instructions are also included for how to exclusively use the keyboard to execute the VI.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run VI
  2. Following buttons of the keyboard are used to move the cursor
    "A": Move cursor left
    "D": Move cursor right
    "W": Move cursor up
    "X": Move cursor down
  3. Use the direction arrows to change the cursor lock option

 

Additional Information or References

Reference

How Do I Programmatically Create a Cursor for a Graph in LabVIEW?

 

VI Block Diagram

 Keyboard Control.png

 

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

Robert B
RF Product Support Engineer
National Instruments

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

Comments
JAYBIOMEDICAL
Member
Member
on

THANK YOU.....

I WANT TO CONTROL CURSOR WITH USING KEYBOARD ON MY GUI.

SO CAN I DO THAT? & IF I CAN THEN PLEASE HELP ME WITH THIS