Mouse 4 and 5 Plugin

I hobbled this together over the weekend. I have never used Csharp before and a lot of the code is way over my head but it seems to be working.
I’m using Rhino 6 right now.
Basicly it catches the Mouse 4 and 5 buttons and runs the commands “_Zoom” and “_Zoom _Target”
I already have zoom all selected for middle mouse and I found these useful to have mapped.

Pointers are welcome, no pun intended

I’m hesitant to put up the RHP file Though

I haven’t tried this yet, but why not pass all the data you get to your event handler? You could use the flags, time and extra info for more advanced features too - double-clicking, dragging, etc.

Otherwise seems to look good.

If you look the mousehook is catching all that data, and I think passing it on but the handler is only looking for the X1 and X2 Buttons. I’m trying to keep it as lightweight performance wise, I tend to have multiple instances of Rhino open and originaly the plugin for every instance of Rhino would catch the button event. Thats why if you look the mousehook first looks if it’s instance of Rhino has “focus” then specifically looks for the WM_XBUTTONDOWN event, otherwise it is constantly spitting out all kinds of mouse events.

It’s still a WIP after initally posting it I already added a command to toggle the funtionality.

I rather meant the other pieces of information. You pass on the point and button information in your raw mouse event, but there is for instance also the time and extra data.

I’m trying to walk before I run, I mostly left that info in for any future referance/use.