PS3 Controller's D-Pad registers as Button 1

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: another_commander, winston, Getafix

Post Reply
evilblade
Average
Average
Posts: 11
Joined: Fri Jun 26, 2020 7:10 pm

PS3 Controller's D-Pad registers as Button 1

Post by evilblade »

Hello, everybody!

Can you please help me out here? I'm using my PS3 Controller in Ubuntu 18.04 and it's working fine. jstest-jdk shows each button of the d-pad as a separate 13, 14, 15 and 16 respectively.. But! Inside Oolite in the joystick configuration any button of the d-pad is registered as "Stick 1 Button 1". Why is that.. and more importantly - is there a way out of this situation?

Update: OK, I found a workaround for my problem - using an antimicro program I mapped d-pad buttons to F1-F4 on a keyboard (can also map them to anything else as well). But if anyone knows of a solution without a 3rd-party programs - I'm all ears here.

Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 373
Joined: Sat Aug 09, 2014 4:16 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by Commander_X »

This might be caused by the way you have your controller installed in Linux. The fact that you use jstest might indicate that you only use the classical "joystick" approach.
I am not too well anchored in joystick/gamepad usage, but my PS3 DS 6axis works nicely here (Slackware current). One thing I am aware I might have different from a vanilla Linux deployment, gamepad wise, is the set of instructions I followed for RPCS3 emulator in order to enable HIDAPI handling for the controller.

... Oh, and welcome to the forums!

evilblade
Average
Average
Posts: 11
Joined: Fri Jun 26, 2020 7:10 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by evilblade »

Well, the thing is - it's working properly in all the other games, so it suprised me to see how it misbehaves in Oolite :shock:
Anyway.. I think this topic is not actual anymore, since I found out that some actions are not even there in "joystick configuration". For example "request clearance".. so it turns out I have to use antimicro anyway :)

Oh.. and thanks for welcoming :)

Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 373
Joined: Sat Aug 09, 2014 4:16 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by Commander_X »

Yes, I'm not sure to what extent the HIDAPI "helps" the js interface (which I think is what Oolite is using).
Well, another thing could be that you're trying to map the D-Pad to actions not appropriate (i.e. that won't get the different buttons of the pad). I have them mapped on the views (forward/aft/port/starboard), and they come as intended. Hope this helps.
I'm with you with missing action mappings in the joystick/gamepad setup. With the whole arsenal of buttons on nowadays devices, the need to use the keyboard and the steering controller at the same time is quite annoying (see my previous "not being anchored" in their usage :) ).

evilblade
Average
Average
Posts: 11
Joined: Fri Jun 26, 2020 7:10 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by evilblade »

Commander_X wrote:
Sun Jun 28, 2020 5:02 pm
Well, another thing could be that you're trying to map the D-Pad to actions not appropriate (i.e. that won't get the different buttons of the pad).
Well, I tried mapping it to all the different actions - the result is always the same - it registers as "Stick 1 Buuton 1", the same button btw as an X on a PS3 controller, so you can't map an X with any direction on d-pad at the same time as well :cry:
Commander_X wrote:
Sun Jun 28, 2020 5:02 pm
I have them mapped on the views (forward/aft/port/starboard), and they come as intended. Hope this helps.
That's exactly what I tried to map it to in the first place :)
Commander_X wrote:
Sun Jun 28, 2020 5:02 pm
I'm with you with missing action mappings in the joystick/gamepad setup. With the whole arsenal of buttons on nowadays devices, the need to use the keyboard and the steering controller at the same time is quite annoying
Well, you don't have to, turns out there are programs like aforementioned antimicro wich can map any joystick button or a direction of an axis to any keyboard key :)

Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 373
Joined: Sat Aug 09, 2014 4:16 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by Commander_X »

Well, there's one more suggestion that might help: xinput. If you open a terminal window, and enter the xinput command, is you PS3 controller visible? I know I disabled it (removed? -- don't remember the parameter) because in my X environment, i had the unpleasant experience to get my pointer moving of its own sometimes :)
If that's not helping, maybe someone else in the forum could provide something more useful. BTW, is there anything reported in you Latest.log file about the joystick? (it might also help if you would mention what Oolite version you're using)

evilblade
Average
Average
Posts: 11
Joined: Fri Jun 26, 2020 7:10 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by evilblade »

Commander_X wrote:
Mon Jun 29, 2020 7:03 am
Well, there's one more suggestion that might help: xinput. If you open a terminal window, and enter the xinput command, is you PS3 controller visible?
Nope, it's not.
Commander_X wrote:
Mon Jun 29, 2020 7:03 am
BTW, is there anything reported in you Latest.log file about the joystick?
[joystick.init]: Number of joysticks detected: 1
Commander_X wrote:
Mon Jun 29, 2020 7:03 am
(it might also help if you would mention what Oolite version you're using)
1.88

But as I mentioned before - nevermind, now that it turned out I have to use antimicro anyway - it doesn't matter how the joystick behaves really :)

Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 373
Joined: Sat Aug 09, 2014 4:16 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by Commander_X »

evilblade wrote:
Mon Jun 29, 2020 3:03 pm
[...] But as I mentioned before - nevermind, now that it turned out I have to use antimicro anyway - it doesn't matter how the joystick behaves really :)
No problem, Happy customer gives Good business :-D

Just as a reference, I checked, and my PS3 controller enabled account also uses 1.88.
Of course, while checking this, a last thought about a (common) issue came: if your Oolite is using your system libraries or those it came with. It could also make sense to know if you're using the www.oolite.org version of the game or the one provided by your distribution.

But don't mind this, again, just left it here in case someone really wanted to dig some more.
<note to self to check what antimicro is>

evilblade
Average
Average
Posts: 11
Joined: Fri Jun 26, 2020 7:10 pm

Re: PS3 Controller's D-Pad registers as Button 1

Post by evilblade »

Commander_X wrote:
Mon Jun 29, 2020 4:27 pm
It could also make sense to know if you're using the www.oolite.org version of the game or the one provided by your distribution.
I've downloaded it from www.oolite.org
Commander_X wrote:
Mon Jun 29, 2020 4:27 pm
<note to self to check what antimicro is>
Oh.. think I've told.. it's a program (one of the) that lets you map your joystick's buttons or axis to any keys on a keybord or mouse buttons. And since there's not every action I want present in the joystick configuration in the game, I use it to map the buttons on the controller to those keys that correspond the desired actions and voila :)

Post Reply