How to get the key pressed in rhino viewport

Hi All,

How can i find out if any key is pressed in rhino view port and which key pressed by using Rhino.Net / Rscript

found the way :wink:

Sharing here if any one needs :

Public Declare Function GetKeyPress Lib “user32” Alias “GetAsyncKeyState” (ByVal key As Integer) As Integer

Uder timer Control :

Private Sub tmr1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr1.Tick
If GetKeyPress(Asc(“W”)) <> 0 Or GetKeyPress(Asc(“w”)) <> 0 Then
msgbox(“W Pressed”)
End If
End Sub