RUNNING WITH RIFLES
http://www.runningwithrifles.com/phpBB3/

More mouse buttons on Linux
http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=5&t=1369
Page 1 of 1

Author:  JOndra91 [ Sat Sep 14, 2013 7:37 pm ]
Post subject:  More mouse buttons on Linux

I have mouse with some additional buttons like forward/backward but a can't use them in the game.
I was able to set actions for scrolling by editing setting.xml and setting values 5 and 6 for scroll up/scroll down. However forward/backward buttons are emmiting mouse events 8 and 9, but after setting these values or higher, game just loads "Mouse 7".

On Windows I was able to set these buttons in game, on Linux a can't use them even after manually changing configuration file. :(

I would like to be able to use these buttons.

Author:  pasik [ Sat Sep 14, 2013 11:07 pm ]
Post subject:  Re: More mouse buttons on Linux

The restriction would seem to be in OIS, Object-Oriented Input System, and the way how they limit mouse button ids to 7: http://code.joyridelabs.de/ois_api/OISM ... ource.html:
Code:
00031         enum MouseButtonID
00032         {
00033                 MB_Left = 0, MB_Right, MB_Middle,
00034                 MB_Button3, MB_Button4, MB_Button5, MB_Button6, MB_Button7
00035         };


I believe the best workaround would be to use some sort of remapping tool.

Author:  JOndra91 [ Sun Sep 15, 2013 2:25 am ]
Post subject:  Re: More mouse buttons on Linux

I managed to get it working by changing LinuxMouse.cpp, adding some mapping to buttons 4 and 5 which is windows like behaviour and replacing library.

If you're interrested, patch is here (I could not upload it as attachment):
https://docs.google.com/file/d/0BywHCeRc4PQodE9pVmgxeV9jTUk/edit?usp=sharing

It should be standard mapping according to this:
http://xahlee.blogspot.cz/2011/05/linuxunix-x11-mouse-button-numbering.html

Author:  Tartifouette [ Wed Aug 16, 2017 11:40 am ]
Post subject:  Re: More mouse buttons on Linux

Hi,

it's still impossible to use keymapping with mouse buttons with the v1.51 of the game and Linux Mint Cinnamon, even if the side buttons of the mouse work under the OS (with firefox for exemple)

I'm interessted by your solution, how to use the file you linked ?

Author:  JOndra91 [ Wed Aug 16, 2017 12:57 pm ]
Post subject:  Re: More mouse buttons on Linux

It's patch for a source code of OSI library and I have repository with applied patch.

https://github.com/JOndra91/OIS

You can download built library from my google drive and just place it into <rwr_install_dir>/lib, replacing the original library bundled with game.

Alternatively if you know how to build stuff and you don't want to use prebuilt library from some random guy on the internet just clone repository and then run following commands in repository directory:
Code:
./boostrap
# I suppose that you are on 64bit system
./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
make


If everything goes well just replace <rwr_install_dir>/lib/libOIS-1.3.0.so with <ois_repo>/src/.libs/libOIS-1.4.0.so. It has to be renamed as libOIS-1.3.0.so.

Also, let me know if it works for you. It has been built on debian and tested on arch, so there should be some distro crosscompatibility.

Author:  Tartifouette [ Thu Aug 17, 2017 2:34 pm ]
Post subject:  Re: More mouse buttons on Linux

Oh yeah, it works !! Thanks a lot, you made my day !!! Should be a sticky topic !

I used the built library from your google drive by the way :)

I've an other problem, I can't use keys 1, 2, 3... or &, é, "... (I mean the number, but not on the keypad). Do you have a solution ? I'm using a FR keyboard configuration.

Author:  JOndra91 [ Thu Aug 17, 2017 3:19 pm ]
Post subject:  Re: More mouse buttons on Linux

Unfortunately I don't have any solution for that (except to use keyboard layout with numeric row), I could take another look at OIS library since it handles keyboard input as well, but I'm not promising anything.

This is a problem that is present in majority of games nowadays. I too don't like having to switch between czech and english keyboard layouts just to use numeric row.

Also, this shouldn't be a sticky topic. These changes should have been implemented in the game. It's really not that hard since I've already provided the code. But apparently no one really needs this. I think that extra mouse buttons work properly on windows.

Author:  Tartifouette [ Fri Aug 18, 2017 10:54 am ]
Post subject:  Re: More mouse buttons on Linux

JOndra91 wrote:
I think that extra mouse buttons work properly on windows.

Yes they do

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/