-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AYN Odin 2 #756
AYN Odin 2 #756
Conversation
Also, you'll see a different GUID in the middle commit. That was from a different tool, and using it in the Godot line didn't work. As far as Godot is concerned, the shorter GUID seems to be the correct one. |
Can you try right-padding the GUID with 0s so it reaches a normal length and see if Godot still picks up the mapping ? The GUID discrepenacy is OK.. Switch mappping is picking up Bus, Vendor, Product, Version values where your mapping for the Odin falls back to the description field ( |
I just checked that and compiled a new APK. That broke the mapping. For whatever reason, the folks over at AYN gave this device a shorter GUID. |
Nothing to do with AYN, something to do with Godot or how it's using SDL. GUIDs are normalized to 32 characters, there is no precedent for shorter, so I'm not going to merge this; the 30+ mappings we have that match this format are all right-padded. Feel free to try the SDL utils on Android if you want to unwind this further |
I didn't pay attention to the padding instructions earlier and put the zeroes on the left side. I just tried it again on the right side and it works. I'll fix my stuff real quick. |
I feel like a total noob now because of that. |
Don't sweat it ! Glad we were able to work out all the kinks :-) Thanks again 👍 |
I've added a line for AYN Odin, but there is one caveat that I'm not sure about.
I got the GUID by writing up a quick and dirty tool in Godot. Basically, I have a label named PadGUID and this line of code:
$PadGUID.set_text (Input.get_joy_guid(0)) #Device GUID
The number it returned is shorter than all the ones in the database. Here it is next to the number for my Switch controller, for comparison:
Interestingly, the number for my Odin works just fine when I feed it back into Godot with this statement:
Input.add_joy_mapping("4f64696e20436f6e74726f6c6c6572,AYN Odin 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b14,dpright:b13,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:+a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,", true)
I had a slightly different version of that line, minus the Godot stuff, in an earlier, now-retracted pull request, and when I went to add in a small fix, that was when I noticed the discrepancy. I don't want to accidentally break something with an incorrectly-formatted GUID, so I'm making sure to mention all this. I don't know if it's an obscure bug somewhere or just the Odin devs being weird.
Things I made sure to do with this mapping:
ABXY buttons mapped by position.
Correct mapping of the left and right triggers.
Correct the minimum value on the left and right triggers.
Test the mapping in a Godot APK to make sure everything works correctly.