zhenglei 发表于 2011-9-28 00:02:07

WinIo如何输入 F11热键???

本帖最后由 zhenglei 于 2011-9-28 00:03 编辑

以下是WinIo例子。。。 我试验了下。只能输入数字及几个固定热键。。。。 我单位的读卡器。。必须按F11才可以使用。。。但以前的PS2键盘坏了。。用了一个USB键盘。。F11按上他的软件系统无法识别,没任何反应。。换PS2的就可以。。所以打算做个程序。例如按CTRL+F1 来实现输入F11热键。。 但。下面的例子中并没有提到按F11的热键功能。。 。不知道哪位大侠知道。。出来指点以下。。。

WinIo 原帖地址:http://www.autoitx.com/forum.php?mod=viewthread&tid=11173&from=favorites#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>



Dim $keyboardPath = "keyboard.exe"

#Region ### START Koda GUI section ### Form=
$WinIO_Test = GUICreate("WinIO_Test", 633, 441, 192, 132)
$Label1 = GUICtrlCreateLabel("winio驱动级键盘模拟输入测试", 56, 32, 325, 33)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("输入", 144, 96, 81, 49)
$Edit1 = GUICtrlCreateEdit("", 56, 160, 353, 209)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                       
               
        Case $Button1
               
                ShellExecuteWait ($keyboardPath, "\w\w\w\w");等待4个250ms
               
                ShellExecuteWait ($keyboardPath, "AaBbCc123DeEeFf")
               
                ShellExecuteWait ($keyboardPath, "\r");输入一个回车                       
               
        EndSwitch
WEnd
页: [1]
查看完整版本: WinIo如何输入 F11热键???