Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: kir2yar on May 25, 2010, 01:01:02 pm

Title: Can I use mouse button 4 .. 7?
Post by: kir2yar on May 25, 2010, 01:01:02 pm
I looked at mouse.cpp and began to suspect that this is not possible.
Title: Re: Can I use mouse button 4 .. 7?
Post by: Fury on May 25, 2010, 01:10:33 pm
Not until fs2_open 3.7 which has new pilot file code that supports more keys.
Title: Re: Can I use mouse button 4 .. 7?
Post by: FUBAR-BDHR on May 25, 2010, 01:20:45 pm
Unless you can find some software that maps those buttons to keys.  Don't really know of any as the question usually comes up for joystick or rudder peddles.
Title: Re: Can I use mouse button 4 .. 7?
Post by: taylor on May 26, 2010, 09:25:01 am
Adding support for additional mouse buttons won't break the pilot code (number of controls do, and that's a different thing), but it wouldn't work very well with the current code.  Mouse and joystick button bindings are combined, so mouse button presses actually trigger joystick button actions.  That means that the maximum number of possible mouse buttons is fixed with the number of joystick buttons, which is currently 32.  But because the controls are shared you end up with weird bugs where pressing a mouse button may very well additionally perform a completely different action which is bound to a joystick button with the same id.  Fixing that properly, which involves adding an additional id just for mouse buttons, does require new pilot code though.

For more mouse button support now we just need the input and event code upgraded to handle it.  So it is possible to do, I just don't think anybody really wants to jump in and do it that badly considering the control binding bug.
Title: Re: Can I use mouse button 4 .. 7?
Post by: kir2yar on May 27, 2010, 11:23:50 am
Quote
Unless you can find some software that maps those buttons to keys.  Don't really know of any as the question usually comes up for joystick or rudder peddles.

I have a logitech g5 mouse

xmodmap -e "pointer = 1 8 3 4 5 6 7 2 9" --- not working
(map mouse8 (side button) to whell button. I often do it in other games)


Quote
But because the controls are shared you end up with weird bugs where pressing a mouse button may very well additionally perform a completely different action which is bound to a joystick button with the same id.

Some use both a joystick and mouse?
Title: Re: Can I use mouse button 4 .. 7?
Post by: Iss Mneur on May 27, 2010, 02:14:18 pm
Quote
But because the controls are shared you end up with weird bugs where pressing a mouse button may very well additionally perform a completely different action which is bound to a joystick button with the same id.
Some use both a joystick and mouse?
Yes, for me, I use the joystick for most things, but because way that FS handles the joystick and my joysticks deadzone is too wide for precision aiming.  I just use the mouse when I need to shoot precisely.

As far as configuring X inputs, I never played with it beyond the setting the resolutions and colour depth.
Title: Re: Can I use mouse button 4 .. 7?
Post by: taylor on May 27, 2010, 06:19:00 pm
Some use both a joystick and mouse?
I do depending on the mod (sometimes you need more precise aiming as opposed to faster movement, like Iss Mneur also noted), but I also use a joystick when actually playing for fun and just keyboard/mouse when testing code changes or looking for bugs.

But like I say, new pilot file code will give us the opportunity to properly support mouse control configuration, which means the major barrier to modifying the mouse/input code to support additional mouse buttons will be gone.  And the new pilot file code isn't that far off now.
Title: Re: Can I use mouse button 4 .. 7?
Post by: kir2yar on May 28, 2010, 02:48:02 am
Well I'll wait.