Author Topic: SDL mouse button remapping?  (Read 2528 times)

0 Members and 1 Guest are viewing this topic.

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
SDL mouse button remapping?
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;

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: SDL mouse button remapping?
What is the old code, and why change it?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

  

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
Re: SDL mouse button remapping?
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..