Mouse event handling(double click) in Rhino, without windows form


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.

(Menno Deij - van Rijswijk) #2

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.



protected override void OnMouseDoubleClick(Rhino.UI.MouseCallbackEventArgs e)
if (e.Button == MouseButtons.Right)
run = false;
//MessageBox.Show(“you double clicked left mouse button !!”);

(Menno Deij - van Rijswijk) #4

Ok, cool. I never tried the MouseCallback - good to know it is working :smile:


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 !

(Menno Deij - van Rijswijk) #6

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.

Capture Sup key in Rhino
(Menno Deij - van Rijswijk) #10

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)

RhinoApp.EscapeKeyPressed event, unable to cancel/consume keypress event

Many thanks! Not sure how to say how much you have helped me.
Many many many thanks !!! :):slight_smile:

(Menno Deij - van Rijswijk) #12

I had it lying around, took me 5 min to put together into a command. Glad I could help :smile:


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. :slight_smile:

(Menno Deij - van Rijswijk) #15

My real name is on my profile page