[question] Can I use the same controller used for authentication?

Need help? Ask here and someone will help
GeekyDeaks
Posts: 46
Joined: Wed Feb 16, 2022 9:44 am

Re: [question] Can I use the same controller used for authentication?

Post by GeekyDeaks »

I'm not going to be able to check my config until next week, but the way I would do it is to simply fire up gimx-config, make sure you are set to the DS4, 'auto detect' the button in the button tab, assign it to the left d-pad and then save. If you do this on a new config, you can open it up and copy it over the xml element to your config. One thing to note if you have not used the config is that on my system I have to press the 'auto detect', then wait for the mouse cursor to disappear (it takes a few seconds), then press the button.

Image
quantum_brake
Posts: 15
Joined: Fri Mar 25, 2022 4:04 pm

Re: [question] Can I use the same controller used for authentication?

Post by quantum_brake »

I get what you mean, but the thing is, I dunno why, but for some reason if I press…say square and assign square to it, it assignes square to cross instead, does that makes sense? so literally, each and every button is shuffled for some reason, and I don't understand why? I had to open gimx with the text output to console and press individual buttons and see how they react and going off of that I would assign buttons in gimx config…so that's the problem.
Now I managed to set it up either way, but the only button that wasn't logging into terminal at all was the left d-pad, and it's the only one I couldn't manage to setup, I dunno how to fix it?

Thanks for your responses, they are really helpful, but I feel like it's either broken install or maybe a driver or something and I dunno how I should troubleshoot it?
quantum_brake
Posts: 15
Joined: Fri Mar 25, 2022 4:04 pm

Re: [question] Can I use the same controller used for authentication?

Post by quantum_brake »

ohhh…okay…I understand what the problem is on a larger scale at the moment, I am using raspberry pi - and it has the problem I was describing, but now I used windows 10 virtual machine on my laptop just to check it, and the official configs works flawlessly, so there's that…
GeekyDeaks
Posts: 46
Joined: Wed Feb 16, 2022 9:44 am

Re: [question] Can I use the same controller used for authentication?

Post by GeekyDeaks »

Oh, I get it now!

Ok, so I'll need to probably check the source code to see what is going on, but I suspect there might be a 'off-by-one' issue going on between windows and linux. Is the problem that when you press the D-pad it doesn't show up at all in the text? Either way, looking at the defines in ds4.h, I see the following masks:

Code: Select all

#define DS4_UP_MASK         0x01
#define DS4_RIGHT_MASK      0x02
#define DS4_DOWN_MASK       0x04
#define DS4_LEFT_MASK       0x08
it looks like the LEFT is going to be one more or less than the DOWN. You should be able to figure out which way from looking at the index for RIGHT.

Does that help?
quantum_brake
Posts: 15
Joined: Fri Mar 25, 2022 4:04 pm

Re: [question] Can I use the same controller used for authentication?

Post by quantum_brake »

Now, I don't understand what the defines you've sent actually mean, but your guess is absolutely correct it is off by one, (dpad down - shows up as dpad left, dpad right - shows up as dpad down… so on and so forth, but dpad left is inactive…like if I press it, it literally doesn't react)

so… if it is a "off-by-one" issue, what should I change to fix it? kinda don't understand it fully yet xD
GeekyDeaks
Posts: 46
Joined: Wed Feb 16, 2022 9:44 am

Re: [question] Can I use the same controller used for authentication?

Post by GeekyDeaks »

Ok, what I would do is simply take a look at what the index is for DOWN e.g.

<event type="button" id="13"/>

And then look for the index that is for RIGHT. If it's 12 for RIGHT, then make the LEFT index 14, otherwise make it 12...

I have a suspicion you might have already tried this though.... and the problem is going to need a bit more digging
quantum_brake
Posts: 15
Joined: Fri Mar 25, 2022 4:04 pm

Re: [question] Can I use the same controller used for authentication?

Post by quantum_brake »

Sorry for the late response, was a bit busy.

Yes, I have tried that before and I was able to set it up for every button except the dpad left, I also can nnow add that when I open gimx-config and use auto detect feature it detects inputs according to the config itself (for example, dpad left is button_id=16, which is exactly how it is in the config), but when I launch gimx to connect it to ps4, it is shuffled then, maybe that can help somehow? should I maybe post any logs if it would be of any help? if you need any logs just tell me, because I still am pretty confused tbh xD

Thank you for your help so far, you give me hope for fixing it all xD
GeekyDeaks
Posts: 46
Joined: Wed Feb 16, 2022 9:44 am

Re: [question] Can I use the same controller used for authentication?

Post by GeekyDeaks »

Ok, some of this is guess work as I don't have access to my windows machine with everything on it...but here goes...

Looking back at the masks:

Code: Select all

#define DS4_UP_MASK         0x01
#define DS4_RIGHT_MASK      0x02
#define DS4_DOWN_MASK       0x04
#define DS4_LEFT_MASK       0x08

#define DS4_SQUARE_MASK     0x10
#define DS4_CROSS_MASK      0x20
#define DS4_CIRCLE_MASK     0x40
#define DS4_TRIANGLE_MASK   0x80
Essentially, the dpad and the 4 shape buttons all come in the same byte in the USB report. e.g.

Code: Select all

TRIANGLE | CIRCLE | CROSS | SQUARE | LEFT | DOWN | RIGHT | UP
Looking at an old config though, it seems that the ID's for the buttons don't come in the same order as the bits, nor do the IDs for the shape and dpad buttons sequently follow. I think just stumbling around with numbers is going to be very frustrating and it might be better to knock up a script and see if you can figure out the proper ID e.g. https://pypi.org/project/pyPS4Controller/ and check it matches what is coming out of gimx-config. This way you can start to narrow down which bit has a problem
quantum_brake
Posts: 15
Joined: Fri Mar 25, 2022 4:04 pm

Re: [question] Can I use the same controller used for authentication?

Post by quantum_brake »

Okay, so using the script you linked I managed to get this:

Code: Select all

button_id: 40 button_type: 22 value: 8 overflow: (1, 1, 0)
button_id: 24 button_type: 23 value: 8 overflow: (0, 1, 0)
button_id: 162 button_type: 45 value: 8 overflow: (1, 1, 1)
button_id: 136 button_type: 46 value: 8 overflow: (0, 1, 1)
button_id: 174 button_type: 53 value: 8 overflow: (1, 1, 2)
button_id: 138 button_type: 54 value: 8 overflow: (0, 1, 2)
button_id: 16 button_type: 61 value: 8 overflow: (1, 1, 3)
button_id: 0 button_type: 62 value: 8 overflow: (0, 1, 3)
button_id: 134 button_type: 88 value: 8 overflow: (1, 1, 4)
button_id: 88 button_type: 89 value: 8 overflow: (0, 1, 4)
button_id: 178 button_type: 99 value: 8 overflow: (1, 1, 5)
button_id: 142 button_type: 100 value: 8 overflow: (0, 1, 5)
button_id: 58 button_type: 134 value: 8 overflow: (1, 1, 8)
button_id: 2 button_type: 135 value: 8 overflow: (0, 1, 8)
button_id: 216 button_type: 146 value: 8 overflow: (1, 1, 9)
button_id: 130 button_type: 147 value: 8 overflow: (0, 1, 9)
button_id: 160 button_type: 172 value: 8 overflow: (1, 1, 10)
button_id: 54 button_type: 173 value: 8 overflow: (0, 1, 10)
button_id: 24 button_type: 188 value: 8 overflow: (1, 1, 11)
button_id: 124 button_type: 188 value: 8 overflow: (0, 1, 11)
button_id: 76 button_type: 196 value: 8 overflow: (1, 1, 12)
button_id: 196 button_type: 196 value: 8 overflow: (0, 1, 12)
button_id: 144 button_type: 248 value: 8 overflow: (-32767, 2, 7)
button_id: 108 button_type: 249 value: 8 overflow: (0, 2, 7)
button_id: 128 button_type: 3 value: 9 overflow: (-32767, 2, 7)
button_id: 208 button_type: 8 value: 9 overflow: (0, 2, 7)
button_id: 150 button_type: 41 value: 9 overflow: (-32767, 2, 6)
button_id: 154 button_type: 42 value: 9 overflow: (0, 2, 6)
button_id: 136 button_type: 45 value: 9 overflow: (32767, 2, 7)
button_id: 170 button_type: 46 value: 9 overflow: (0, 2, 7)
button_id: 138 button_type: 48 value: 9 overflow: (32767, 2, 6)
button_id: 212 button_type: 49 value: 9 overflow: (0, 2, 6)
button_id: 52 button_type: 54 value: 9 overflow: (-32767, 2, 7)
button_id: 86 button_type: 55 value: 9 overflow: (0, 2, 7)
button_id: 124 button_type: 97 value: 9 overflow: (32767, 2, 6)
button_id: 140 button_type: 101 value: 9 overflow: (0, 2, 6)
button_id: 188 button_type: 103 value: 9 overflow: (-32767, 2, 6)
button_id: 54 button_type: 107 value: 9 overflow: (0, 2, 6)
button_id: 136 button_type: 110 value: 9 overflow: (-32767, 2, 7)
button_id: 234 button_type: 112 value: 9 overflow: (0, 2, 7)
button_id: 152 button_type: 114 value: 9 overflow: (32767, 2, 7)
button_id: 180 button_type: 116 value: 9 overflow: (0, 2, 7)
Now, if I read this correctly, then the only number worth looking for was the last number right before the closing bracket, because it corresponded to the button_id in the gimx-config (I skipped 6 and 7 because those are considered axis and it would've just spammed alot of unneeded responses), after I got to the dpad though (after the number 12 in the last number before the closing bracket) it is probably a confirmation to what you said? It being sent in the same byte and all. But then again while this may be correct and I get inputs from all the buttons and axis(except for touchpad, because it is considered a mouse in the OS) If I were to launch gimx I would get the "shifted" inputs, again if the button ID is 0 (cross) it would shift by one and I would instead get a button ID 1(circle), see on the screenshot here:

https://imgur.com/a/hymLH6t where "r3" is me pressing PS button, "circle" is me pressing the cross button, and "triangle" is me pressing circle.

This was tested on the official Dualshock4.xml downloaded from https://github.com/matlo/GIMX-configura ... ster/Linux
quantum_brake
Posts: 15
Joined: Fri Mar 25, 2022 4:04 pm

Re: [question] Can I use the same controller used for authentication?

Post by quantum_brake »

Actually…now that I think of it…since it shift by +1, it means that dpad left is now button ID 17 and it is out of bounds, correct? so I either need to somehow shift all the button IDs by -1, so that after this bug hits it it will leveled out correctly, or…find the issue in gimx itself lol
Post Reply