Swordfish90 / Lemuroid

All in one emulator on Android!
GNU General Public License v3.0
2.4k stars 153 forks source link

Movement keys #670

Open 6Flash9 opened 1 year ago

6Flash9 commented 1 year ago

With joystick,Cant use movement keys in game but can use for navigation

newhinton commented 1 year ago

I would like to know this aswell.

There is:

https://github.com/Swordfish90/Lemuroid/blob/187ebcd34cb812215b7b898079d9e0dec1b917cc/lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt#L627

But i dont know if that is actually what i want. Is there a way to send joystick-movements as dpad actions to a core (that does not use the joystick itself)? If not, im willing to take a shot at it, but i am not really sure where to start. Thanks!

Edit:

Forcing mergeDPADAndLeftStickEvents==true will allow the left pad to act as a joypad. Is there a way to expose this setting?

Edit2:

                var allowJoypad = controllerConfigsState.value[port]?.mergeDPADAndLeftStickEvents ?: false
                when(system.id) {
                    SystemID.NES -> allowJoypad = true
                    SystemID.SNES -> allowJoypad = true
                    SystemID.GENESIS -> allowJoypad = true
                    SystemID.GB -> allowJoypad = true
                    SystemID.GBC -> allowJoypad = true
                    SystemID.GBA -> allowJoypad = true
                    SystemID.NDS -> allowJoypad = true
                }

                if (allowJoypad) {

Inserting that snippet in the file linked above will make it work. The list above is probably not complete, but it should be safe for them to get merged inputs.