From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



在LabVIEW中如何禁用键盘



主要软件:
主要软件版本: 1.0
主要软件修正版本: N/A
次要软件: N/A

问题: 在LabVIEW中,当程序运行的时候我想要把键盘禁用掉。这样的话当程序在执行的时候用户无法输入任何东西。同时我也想要在程序之后启用键盘,应该如何做?

解答:

有下列几种方法能够来解决这个问题

需要注意的是放弃事件的布尔控制会阻止用户输入的命令,它只对用户界面有作用。例如,即使用户在按键,也无法输入在文本框或者数值字符串输入控件中输入文字了。键按下的事件结构如下图所示,链接中有范例程序.

注意:需要小心使用禁用模式。当键被禁用时有程序死机了,键盘对其他程序也是无法访问的。

注意:这个选项只在微软XP下使用



相关链接: Example Program: Using the LabVIEW Key Down Event
KnowledgeBase 1GRAN2U0: Where Can I Get Help Calling Windows API Functions from LabVIEW?
External Link: Microsoft Windows API Function: EnableHardwareKeyboard

附件:


DiscardKeystrokes.vi - DiscardKeystrokes.vi



报告日期: 10/28/2004
最近更新: 02/26/2015
文档编号: 3ERI9RHB