Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Key Down? Event

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Requires: Base Development System

Class: Control Events

Type: Filter

Generated on a control that has keyboard focus. If a key press matches a keyboard shortcut in the VI menu, such as Ctrl-C or Ctrl-V, LabVIEW does not generate a Key Down event, regardless of whether the menu item is enabled.

Key Down Event Caveats

  • (Windows) F3 generates a Key Down event only in the LabVIEW Run-Time Engine.
  • LabVIEW only generates events for the Cluster»All Elements source when the cluster has keyboard focus, not when an individual element inside the cluster has keyboard focus.

Event Data Fields

NameDescription
SourceSource of the event. LabVIEW UI refers to any built-in user interface event.

0LabVIEW UI
TypeType of event that occurred, such as Mouse Down, Value Change, Timeout, and so on.
TimeValue of the millisecond timer when the event occurred.
TimeValue of the millisecond timer when the event occurred.
CharInteger value that corresponds to the key pressed on the keyboard and represents a character from the current code page that your system uses. You also can modify the data returned by this event data field. Search for code pages on the Microsoft Web site for a listing of the code page tables supported by Windows.
VKeyEnumerated type indicating the virtual key code of the key pressed. Values include ASCII, Shift, NumLock, F1, and so on. You also can modify the data received from this event data field.
Note  VKey has separate values for the <Enter> key on the alphanumeric keyboard and <Enter> key on the numeric keypad.
ScanCodeScan code unique for each key on the keyboard. The values are unique for each physical key, and allow you to match Key Up and Key Down events.
ModsCluster of Booleans that contain platform-independent modifiers. LabVIEW returns all platform-dependent modifiers in the PlatMods event data field. For key events, this event returns a Boolean indicating if the event occurred on the numeric keypad. For mouse events, this event returns a Boolean indicating if the event was a double-click. For both events, a Boolean is returned if the platform-independent menu key, such as <Ctrl> on Windows or <Command> on Mac OS X, was pressed when the event occurred. For filter events, you can modify the data returned by this event data field.
PlatModsCluster of Booleans that contain platform-dependent modifiers. Specifies if platform-dependent keys, such as <Ctrl>, <Shift>, <Alt>, <Command>, and <Option> were held down when the event was triggered. For filter events, you can modify the data returned by this event data field. A key can be both a Mod and PlatMod. For example, <Ctrl> is the platform-independent menu key on Windows, but you also can use it in platform-dependent programming.
FocusObjA reference to the object that has keyboard focus. When the event is for a control, it might be a sub-component, like a scale, label, and so on, rather than the control itself. You also can modify the data returned by this event data field.
Discard?Allows you to prevent LabVIEW from processing the event, bypassing the behavior normally triggered by that event. The default is FALSE.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit