キーでイベントを起こす
user32.lib の GetAsyncKeyState を使用する。
- GetAsyncKeyState(MSDN)
- http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/jpwinui/html/_win32_getasynckeystate.asp
Declare Function GetAsyncKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Sub KeyEventTest() Do While 1 If GetAsyncKeyState( vbKeyA ) <> 0 Then MsgBox ("Press A Key") Exit Do End If Loop End Sub