Five Mouse Buttons

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Five Mouse Buttons

Post 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.
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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!
Image Image Image
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post 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.
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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 :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
>
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

Many tanks to you.I must implement this and recompile irrlicht. :D
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post 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
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
Post Reply