protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var gp = new Rhino.Input.Custom.GetPoint();
RhinoApp.KeyboardEvent += OnKeyboar;
while (true)
{
gp.Get();
if (gp.CommandResult() != Result.Success)
break;
}
RhinoApp.KeyboardEvent -= OnKeyboar;
return Result.Success;
}
private void OnKeyboar(int key)
{
RhinoApp.WriteLine("The key value is:{0}", key);
}
If you switch to other software and then switch back to Rhino, the KeyboarEvent will be lost.