Pauses for user input of a keyboard key. Pressing the <Esc> key will cancel the operation.
Rhino.GetKey ([strMessage])
strMessage |
Optional. String. A prompt or message. |
Array |
An array that contains information about the key that was pressed if successful. The array will contain the following:
|
||||||||||||||||||||||||||||||
Null |
If not successful, or on error. |
Sub TestGetKey
Dim key, shift, ctrl, alt, capslock, numlock, scrllock
key = Rhino.GetKey("Press a key")
While Not IsNull(key)
shift = CBool(key(1) And &h1)
ctrl = CBool(key(1) And &h2)
alt = CBool(key(1) And &h4)
capslock = CBool(key(1) And &h8)
numlock = CBool(key(1) And &h10)
scrllock = CBool(key(1) And &h20)
Call Rhino.Print("Virtual key: " & CStr(key(0)) & ", flags: " & CStr(key(1)))
Call Rhino.Print(" Chr: " & Chr(key(0)))
Call Rhino.Print(" Shift: " & CStr(shift))
Call Rhino.Print(" Ctrl: " & CStr(ctrl))
Call Rhino.Print(" Alt: " & CStr(alt))
Call Rhino.Print(" CapsLock: " & CStr(capslock))
Call Rhino.Print(" NumLock: " & CStr(numlock))
Call Rhino.Print(" ScrollLock: " & CStr(scrllock))
key = Rhino.GetKey
Wend
End Sub