掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
OS上の全てのキーボードイベントを拾うには? (ID:117680)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
作ってみました。 Private Declare Function GetKeyState Lib "User32.dll" (ByVal Key As Integer) As Long Private Declare Function timeGetTime Lib "winmm.dll" () As Long Private Sub Form_Load() Timer1.Interval = 10 End Sub Private Sub Timer1_Timer() Static timeFlag As Boolean Static startTime As Long Static endTime As Long If (GetKeyState(&H7A) < 0) Then If timeFlag = False Then startTime = timeGetTime End If timeFlag = True Exit Sub End If If timeFlag Then endTime = timeGetTime MsgBox endTime - startTime & " mSec押下" End If timeFlag = False End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.