Page 1 of 1

Five Mouse Buttons

Posted: Sun Oct 29, 2006 5:39 pm
by belfegor
I have five mouse buttons, as i can see in irrlicht i have access to
three of them.
Is this planed in future releases of irrlicht to add two more.

Posted: Sun Oct 29, 2006 5:48 pm
by JP
It probably wouldn't be a good idea to use 5 mouse buttons in your game as most mouses only have 2 or 3 so players of your game could run into difficulties!

But then it would be ok if you allowed the user to configure the controls themselves!

Posted: Sun Oct 29, 2006 5:55 pm
by belfegor
I dont see why it would be a problem.Most games have 5 button support.
But then it would be ok if you allowed the user to configure the controls themselves!
It would be very bad game to make without option to change controls.

Posted: Sun Oct 29, 2006 7:59 pm
by bitplane
well... you could send niko, hybrid or myself a mouse with 5 buttons :lol:
or you could look at how the usual three buttons are done, make the changes and post a patch for us to include in the next version :)

Posted: Mon Oct 30, 2006 1:57 am
by vitek
I'm pretty sure the diffs would look something like this for windows. Of course the patch isn't very useful unless it behaves the same on all platforms...

Code: Select all

==================== IEventReceiver.h
45a46,51
>               //! X button 1 was pressed down.
>               EMIE_XBUTTON1_PRESSED_DOWN,
>
>               //! X button 2 was pressed down.
>               EMIE_XBUTTON2_PRESSED_DOWN,
>
54a61,66
>               //! X button 1 was left up.
>               EMIE_XBUTTON1_LEFT_UP,
>
>               //! X button 2 was left up.
>               EMIE_XBUTTON2_LEFT_UP,
>

===================== CIrrDeviceWin32.cpp
71d70
<
182a182,227
> #if (_WIN32_WINNT >= 0x0500)
>       case WM_XBUTTONDOWN:
>               event.EventType = irr::EET_MOUSE_INPUT_EVENT;
>               event.MouseInput.X = LOWORD(lParam);
>               event.MouseInput.Y = HIWORD(lParam);
>
>               switch(GET_XBUTTON_WPARAM(wParam))
>               {
>               case XBUTTON1:
>                       event.MouseInput.Event = irr::EMIE_XBUTTON1_PRESSED_DOWN;
>                       break;
>               case XBUTTON2:
>                       event.MouseInput.Event = irr::EMIE_XBUTTON2_PRESSED_DOWN;
>                       break;
>               default:
>                       return FALSE;
>               }
>
>               dev = getDeviceFromHWnd(hWnd);
>               if (dev)
>                       dev->postEventFromUser(event);
>               return TRUE;
>
>       case WM_XBUTTONUP:
>               event.EventType = irr::EET_MOUSE_INPUT_EVENT;
>               event.MouseInput.X = LOWORD(lParam);
>               event.MouseInput.Y = HIWORD(lParam);
>
>               switch(GET_XBUTTON_WPARAM(wParam))
>               {
>               case XBUTTON1:
>                       event.MouseInput.Event = irr::EMIE_XBUTTON1_LEFT_UP;
>                       break;
>               case XBUTTON2:
>                       event.MouseInput.Event = irr::EMIE_XBUTTON2_LEFT_UP;
>                       break;
>               default:
>                       return FALSE;
>               }
>
>               dev = getDeviceFromHWnd(hWnd);
>               if (dev)
>                       dev->postEventFromUser(event);
>               return TRUE;
> #endif
>

Posted: Mon Oct 30, 2006 2:47 am
by belfegor
Many tanks to you.I must implement this and recompile irrlicht. :D

Posted: Mon Oct 30, 2006 3:04 am
by sgt_pinky
bitplane, I know about your crappy ball mouse - I think you are fishing in the wrong place for a nice shiny 5 button cordless mouse. :D