Gamepad on linux

Monkey Targets Forums/Desktop/Gamepad on linux

Sensei(Posted 2014) [#1]
Hey guys.
Was wondering if anybody else has played with joypads on linux yet?
I followed the instructions on this url http://www.omgubuntu.co.uk/2013/07/dealing-with-xbox-controllers-in-ubuntu and when i don't add the commandline --silent switch, I can see the various buttons and triggers working. However they do appear differently from what is available in Monkey.
Note the screenshot attached shows all the buttons are set to 1 without being pressed at all.
The only two things working at the mo is the two analog controls.

Dropbox

EDIT: An example of the output provided by the xboxdrv
Controller:        Microsoft Xbox 360 Controller
Vendor/Product:    045e:028e
USB Path:          001:005
Controller Type:   Xbox360

Your Xbox/Xbox360 controller should now be available as:
  /dev/input/js0
  /dev/input/event10

Press Ctrl-c to quit, use '--silent' to suppress the event output

X1: -7168 Y1:  7424  X2:     0 Y2:  -256  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-22272 Y1: 21248  X2:     0 Y2:  -256  du:0 dd:0 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-24576 Y1: 19456  X2:     0 Y2:  -256  du:0 dd:1 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-30976 Y1: 11008  X2:     0 Y2:  -256  du:0 dd:1 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-32768 Y1:     0  X2:     0 Y2:  -256  du:0 dd:1 dl:0 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-31744 Y1:     0  X2:     0 Y2:  -256  du:0 dd:1 dl:1 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-25856 Y1:     0  X2:     0 Y2:  -256  du:0 dd:1 dl:1 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0
X1:-21760 Y1:     0  X2:     0 Y2:  -256  du:0 dd:1 dl:1 dr:0  back:0 guide:0 start:0  TL:0 TR:0  A:0 B:0 X:0 Y:0  LB:0 RB:0  LT:  0 RT:  0



Any suggestions/ideas/other drivers to try?


Sensei(Posted 2014) [#2]
As an update. I removed xboxdrv and installed xpad. As before in Monkey joytest.monkey, all the digital buttons are pressed, displaying a 1 next to it as in the attached dropbox link above.
Has absolutely nobody worked with joysticks/pads on linux using Monkey to date?


dawlane(Posted 2014) [#3]
I will dig out the Logitech Wingman joystick and have a look at it if I get the time. But I have never used a joypad as I think they are crap (could never get use to using my xbox controler). But at a quick guess the it may need remapping with jstest-gtk. This tool should be in the ububtu/Linux Mint repository.


Sensei(Posted 2014) [#4]
Hi Dawlane. Thanks once again for your reply. I downloaded and am running jstest-gtk and the majority of things work fine out of the box.
The problem is not with the controller or driver. It appears to be a Monkey specific issue where the buttons (A, B, X, Y, etc) are pressed even when not pressed.
Load up joytest.monkey and see for yourself.

I've installed Steam on Mint and have played Fez with it as-is and other than the A and B buttons being swapped around, they actually work. In Monkey, the buttons do not work at all.

I looked at the mojo modules input.monkey and inputdevice.monkey and I'm unsure how anything in there could be "wrong". Looking at JoyDown in input.monkey it uses a binary shift though, so unsure how that all works..


dawlane(Posted 2014) [#5]
What version of Monkey are you using. There is a bug in 78h that causes this problem with joysticks with less than 12 buttons.
If it's not then it's a case of having to see what values are being returned by glfwGetJoystickButtons (it will be an array) and as I haven't got an xbox control that I plug into the computer it will a problem for me to check out. Checking what value is being passed with KEY_JOY0 | unit Shl 5 | button. And look to see what's going on in the BeginUpdate Method of inputdevice.monkey.
And here's some thing that may be of use.
You should also do a forum search for joysticks. There are a few that mention the xbox controllers and odd quirks.


Sensei(Posted 2014) [#6]
Great find Dawlane. I do think I'm using 78h on Mint, but I'm at work at the mo so can't check. I'll investigate if that typo exists though and will let you know how it goes.


dawlane(Posted 2014) [#7]
Finally got some time to check this with my good old Logitect WingMan Digital 3D (this stick must be over 10 years old now). The old boy was doing the same and the typo was still there in v79e. I fixed it and now it works as it should, though the hat and two of the buttons are not registering. I guess Mark didn't push the fix to github. The experimental v80 joystick code has been overhauled.
Before posting it's always a good idea to check to see if quirks or bugs have already been reported.

Edit: Only the hat isn't working with Monkey.


Sensei(Posted 2014) [#8]
Thanks for the update mate, and thanks for making the effort to troubleshoot this. Much appreciated. I will test the fix and get the latest Monkey builds to test on and see how it goes.


Sensei(Posted 2014) [#9]
So, I tried version version 79e and made the typo fix in glfwgame.cpp as suggested by mr_twister and yourself, and it worked a treat in joytest.monkey, as well as in my game. I am one happy bunny now, so many thanks! I will keep an eye on new releases in the future to see what bugs exist and are being fixed, so thanks once again Dawlane!