Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: castor on February 07, 2009, 04:46:04 pm

Title: SDL mouse button remapping?
Post by: castor on February 07, 2009, 04:46:04 pm
K, I recon the mouse control code, and the control device code in general is being worked on, but still..
Any hope for
Code: [Select]
             case SDL_MOUSEBUTTONUP:
if (event.button.button == SDL_BUTTON_LEFT)
mouse_mark_button( MOUSE_LEFT_BUTTON, event.button.state );
else if (event.button.button == SDL_BUTTON_MIDDLE)
mouse_mark_button( MOUSE_MIDDLE_BUTTON, event.button.state );
else if (event.button.button == SDL_BUTTON_RIGHT)
mouse_mark_button( MOUSE_RIGHT_BUTTON, event.button.state );

            break;

Code: [Select]
case SDL_MOUSEBUTTONUP:
if (event.button.button == SDL_BUTTON_LEFT)
mouse_mark_button( MOUSE_LEFT_BUTTON, event.button.state );
else if (event.button.button == 8)
mouse_mark_button( 8, event.button.state );
else if (event.button.button == SDL_BUTTON_RIGHT)
mouse_mark_button( MOUSE_RIGHT_BUTTON, event.button.state );

break;
Title: Re: SDL mouse button remapping?
Post by: chief1983 on February 08, 2009, 01:35:08 am
What is the old code, and why change it?
Title: Re: SDL mouse button remapping?
Post by: castor on February 08, 2009, 05:49:26 am
Hmm.. crap. Seems I clicked the wrong button after all - was supposed to cancel that post (was too tired to finish it - and the edits there are buggy).

Thing is, recently I've had hard times remapping the mouse buttons as I like to have them (linux). It used to work fairly well with xmodmap, but at some point this stopped working. Haven't figured out why - is it some sort of a general problem, or just specific to Debian, or just specific to my setup.

Anyway, since then the only way to get my mouse sidebutton mapped has been to patch in the button code from xev in place of "SDL_BUTTON_MIDDLE" in the IF clause above.
I was just wondering if FSO itself could allow remapping the button codes (through fs2_open.ini)? Dunno, maybe that is a no-no-no thing to do, or already taken care by the new input code that is in the works (iirc). Just wondering..