laamaa / m8c

Cross-platform M8 tracker headless client
Other
409 stars 85 forks source link

[SHIFT]+[OPTION] on gamepad doesn't enter selection mode? #70

Closed djthread closed 2 years ago

djthread commented 2 years ago

Hi! I'm just getting started with my Raspberry Pi headless setup with an 8BitDo NS30 pro controller. In qjoypad, I can see my buttons are reflected exactly as they should be, and I can press shift and option at the same time and see them both light up.

However, in m8c, this combo does not seem to do anything. Pressing and holding both at the same time, my arrows move between screens as if only shift was held. No magenta highlight as I get with the keyboard. I notice [SHIFT]+[EDIT] does paste as expected, so not all combos seem to have this issue.

Have I missed something? Any guess what might be happening? m8c seems awesome, otherwise. I really appreciate the work going into it!!

laamaa commented 2 years ago

Just a guess, but try checking your joypad mappings with https://generalarcade.com/gamepadtool/ and copy the game controller database file into /home/your-username/.local/share/m8c/

djthread commented 2 years ago

Thank you very much for that reply, laamaa! I noticed gamepadtool is a binary-only distribution, so I wasn't able to run it on my ARM64 raspberry pi 4, but I put it on my Mac and paired the same controller. (Weirdly, right and down on both my analog sticks were not registered when I was prompted, so I skipped those. I also skipped L2 and R2 because I intend to reserve them for extra controls via qjoypad.)

I don't see a controller database file referenced in gamepadtool -- only the ability to set an environment variable or copy the mapping data to OS clipboard. It doesn't seem to be in a compatible format, but the buttons in question (0, 1, 3, 4) seem correct. They do seem to work properly, otherwise, in m8c.

Here's what it gave me:

03000000c82d00000161000000010000,8Bitdo SN30 Pro,platform:Mac OS X,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,-leftx:a0,+leftx:a1,lefty:+a1,-rightx:a2,+rightx:a3,righty:+a3,
laamaa commented 2 years ago

If I understood correctly, you now have the mapping string and just need to add it to the gamecontrollerdb.txt file

djthread commented 2 years ago

I was surprised to see that gamecontrollerdb.txt file.. I guess I'm not sure how things work here between the txt and the [gamepad] section of config.ini. In this evening's attempt, I redid the mapping in gamepadtool on the Mac. This time, I noticed it ended with platform:Mac OS X, and I wonder what the significance of that is since I'm trying to make this work under Raspberry Pi OS.

I see the txt file in the source directory, but I'm not exactly sure how or when it's used. I added my line to the file and did make clean, make and make install again in case that was needed. I then used QJoyPad to identify the buttons by number and updated them in config.ini. QJoyPad won't take into consideration the mapping I did in gamepadtool though, of course...

And sure enough, the buttons don't seem to be mapped as I intended in m8. Can you help me understand the relationship between these 2 files? They both seem to map message numbers to buttons. What should be the process to set up a mapping from nothing?

Thank you so, so much for your help & patience, Jonne!

smootalicious commented 2 years ago

The gamecontrollerdb.txt file is what SDL uses to identify the gamepad. It is specific to the platform, so if you are running it under Linux you need the Linux defifinition in the file. The m8c config.ini file uses the SDL index numbers to map the buttons to the M8 functions. Those can be found here https://wiki.libsdl.org/SDL_GameControllerButton. I made a Linux helper that you might want to use on the pi and see if it helps https://github.com/smootalicious/gamepad_config - you can use this to create a gamecontrollerdb.txt entry and also a config.ini snippet.

smootalicious commented 2 years ago

Also you don't need to recompile after adding information to either file. Just start m8c and it should pick up the changes.

djthread commented 2 years ago

Sorry I dropped off on this. I've now received my M8 (wow) and I'm not as hot on getting to the bottom of my headless issue.

Still, thanks for the help!

laamaa commented 1 year ago

Just a guess, but try checking your joypad mappings with https://generalarcade.com/gamepadtool/ and copy the game controller database file into /home//.local/share/m8c/

On Sat 28. May 2022 at 21.59, Adam Bellinson @.***> wrote:

Hi! I'm just getting started with my Raspberry Pi headless setup with an 8BitDo NS30 pro controller. In qjoypad, I can see my buttons are reflected exactly as they should be, and I can press shift and option at the same time and see them both light up.

However, in m8c, this combo does not seem to do anything. Pressing and holding both at the same time, my arrows move between screens as if only shift was held. No magenta highlight as I get with the keyboard. I notice [SHIFT]+[EDIT] does paste as expected, so not all combos seem to have this issue.

Have I missed something? Any guess what might be happening? m8c seems awesome, otherwise. I really appreciate the work going into it!!

— Reply to this email directly, view it on GitHub https://github.com/laamaa/m8c/issues/70, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNUYFUXTRCVPX5XEIXQEADVMJUHTANCNFSM5XHAIYCQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>