Declare
PtrSafe
Function
GetAsyncKeyState
Lib
"user32.dll"
(
ByVal
vKey
As
Long
)
As
Integer
Sub
Test()
Dim
Keypress1
As
Boolean
, Keypress2
As
Boolean
Application.OnKey
"{"
& vbKeySpace &
"}"
,
""
Application.OnKey
"{"
& vbKeyE &
"}"
,
""
Do
Keypress1 =
CBool
(GetAsyncKeyState(vbKeySpace))
Keypress2 =
CBool
(GetAsyncKeyState(vbKeyE))
DoEvents
Loop
Until
Keypress1
Or
Keypress2
If
Keypress1
Then
GoTo
Start
ElseIf
Keypress2
Then
GoTo
Ende
End
If
Start:
Ende:
Application.OnKey
"{"
& vbKeySpace &
"}"
Application.OnKey
"{"
& vbKeyE &
"}"
End
Sub