mouse event handling(double click) is not working without windows form. Double click is not recognized. I have tried with timer. Timer works really cool in windows form ad with buttons. But without windows form, I am unable to use timer.
All good when i am using windows form… but without windows form i am not able to trigger double click … i do not want to use windows form for this particular solution.
It seems RhinoCommon has a MouseCallback class. If you inherit from this, enable it and override the OnDoubleClick method, you should be getting double clicks without using Forms.
http://4.rhino3d.com/5/rhinocommon/html/AllMembers_T_Rhino_UI_MouseCallback.htm
THANKS MENNO!
OH JUST THIS BIT OF CODE IS WORKING , i DO NOT NEED TO IMPLEMENT TIMER AGAIN…
protected override void OnMouseDoubleClick(Rhino.UI.MouseCallbackEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
run = false;
//MessageBox.Show(“you double clicked left mouse button !!”);
}
base.OnMouseDoubleClick(e);
}
Ok, cool. I never tried the MouseCallback - good to know it is working
Hi Menno, Do you know how to implement keyboard event without using windows form.?. I have used keyboard event handling via windows form but never used without a form.
If you have any idea, please let me know.
Many thanks !
Are you only on Windows? In that case, it is possible to use the “native” windows keyboard events. I have an example, will post tomorrow.
yes, i am in windows…thanks! it will be a big help.
i know how to trigger key event via windows.form, but for this project, i am not able to use windows form.So i need to know other alternatives.
I need to implement “0” and “-” keyboard key to two actions in rhino plugin. Do I need to use hooks? I have no idea without windows form . But for this particular task I am not able to use windows.form
yes, i am in windows…thanks! it will be a big help if you give me any sample code. I normally handle geometry problem, and this is new to me…
i know how to trigger keyboard event via windows.form, but for this project, i am not able to use windows form. So i need to know about other alternative.
Please find attached an example of using the keyboard callback. It is indeed using hooks. (remove .txt extension of course)
keyboard listener example command.cs.txt (10.7 KB)
Many thanks! Not sure how to say how much you have helped me.
Many many many thanks !!! :)
I had it lying around, took me 5 min to put together into a command. Glad I could help
The last email came from Steve’s email address, I have notices suddenly and I became confused thinking it is Steve.Many Thanks Menno !I do not know your real name.
My real name is on my profile page http://discourse.mcneel.com/users/menno