#If Win64 Then Private Declare PtrSafe Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Long #Else Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Long #End If ... If 0 <> GetAsyncKeyState(vbKeyControl) Then 'コントロールキーを押されてる End If
ネタ元