minecraft-linux / mcpelauncher-manifest

The main repository for the Linux and Mac OS Bedrock edition Minecraft launcher.
https://minecraft-linux.github.io
GNU General Public License v3.0
975 stars 99 forks source link

Touch controls on flatpak #815

Open TheKrafter opened 1 year ago

TheKrafter commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, this is the best way to play minecraft on linux phones-- except for one thing-- controls. Input with squeekboard doesnt work great (understandable) but you cannot access the pause menu, inventory, move around, or even look around well without plugging in a keyboard and mouse.

Describe the solution you'd like It'd be great to have an option in the launcher settings to launch the game with touch controls enabled (as there is no option for this in the game itself)

Describe alternatives you've considered Ive tried using squeekboard (the phosh OSK) but alas-- it didnt work.

Additional context This is the only easy and efficient way to play mc on mobile linux.

ChristopherHX commented 1 year ago

Touch input is not supported in the flatpak (glfw).

You need to install the AppImage, https://github.com/minecraft-linux/pkg or build from source.

TheKrafter commented 1 year ago

oh ok thanks!

TheKrafter commented 1 year ago

@ChristopherHX might i ask what would be required (or if its even possible) enable touch input on the flatpak?

ChristopherHX commented 1 year ago

what would be required

One of the these options must be true

Switching to eglut would kill my plans for enabling wayland + x11 again, once glfw 3.4 stabilizes

ghost commented 1 year ago

raylib has touch compatabillity, and also uses glfw, maybe look at what it does

TheKrafter commented 1 year ago

also, the AppImage does not work on non-gnu systems, such as postmarketOS (Alpine-Based). so the appimage isnt even an option for me atm. though i think it could be added to the ci?

ChristopherHX commented 1 year ago

This launcher is not working with alpine libc, my experimental musl port seem to not even run at all / crash very early. The only non gnu libc, which works is the macOS libc.

alpine seem to have gnu libc compat, which may make the appimage / built from source work.

I could add the eglut mode to the flatpak as opt in, this requires the launcher to have two runtime window implementations. One with touch and another one with gamepads.

However this feature may take while as long there is no much demand from the community.

ChristopherHX commented 1 year ago

See this PR https://github.com/flathub/io.mrarm.mcpelauncher/pull/107

This is an eglut build of the flatpak and should have the exact same features as the AppImage, but doesn't require glibc installed directly in the host system due to it's own copy of it.

You can install the test build, if you also have the normal flatpak you might need to type flatpak run io.mrarm.mcpelauncher//test to start it.

TheKrafter commented 1 year ago

Thanks, That build works flawlessly on my PPP with touch controls!

Having eglut as an opt-in mode to the flatpak would probably be the best option, yes. I understand if there isn't demand for this, no worries!

Henry-Hiles commented 3 weeks ago

This launcher is not working with alpine libc, my experimental musl port seem to not even run at all / crash very early. The only non gnu libc, which works is the macOS libc.

alpine seem to have gnu libc compat, which may make the appimage / built from source work.

I could add the eglut mode to the flatpak as opt in, this requires the launcher to have two runtime window implementations. One with touch and another one with gamepads.

However this feature may take while as long there is no much demand from the community.

Is this available as an opt-in as of yet?

Henry-Hiles commented 3 weeks ago

Maybe this can be used? https://github.com/glfw/glfw/issues/42#issuecomment-2346606489

ChristopherHX commented 3 weeks ago

Is this available as an opt-in as of yet?

No, the interest gone into the void. Having multiple window systems in a single binary hasn't been investigated further.

I rebased the sdl3 port for you, feel free to install it once the flathub bot finishs creating it for you: https://github.com/flathub/io.mrarm.mcpelauncher/pull/137/

Comment there how well this works, may replace glfw sometime in the future eventually breaking change 2.0.0

I'm scared about regressions at this level.

ChristopherHX commented 3 weeks ago

Maybe this can be used? glfw/glfw#42 (comment)

No, not worth the effort. Killing both eglut and glfw is on my agenda

Henry-Hiles commented 3 weeks ago

Is this available as an opt-in as of yet?

No, the interest gone into the void. Having multiple window systems in a single binary hasn't been investigated further.

I rebased the sdl3 port for you, feel free to install it once the flathub bot finishs creating it for you: flathub/io.mrarm.mcpelauncher#137

Comment there how well this works, may replace glfw sometime in the future eventually breaking change 2.0.0

I'm scared about regressions at this level.

Thank you, I'll try it tonight!

Henry-Hiles commented 3 weeks ago

Works almost perfectly! Only issue is that the imgui ui can't be interacted with, so I can't fullscreen or anything. If that can be fixed this would be perfect!

ChristopherHX commented 3 weeks ago

Only issue is that the imgui ui can't be interacted with

Just not implemented.

Henry-Hiles commented 2 weeks ago

Only issue is that the imgui ui can't be interacted with

Just not implemented.

For a quick workaround, is there a way for me to enable alt to focus imgui via a settings file or something?

ChristopherHX commented 2 weeks ago

write menubarFocusKey=alt into the settingsfile shown in the log

I would just do this with the menubar using a pc mouse on my phone. No my phone has android and the mouse works even there.

Also f11 on keyboard = fullscreen, that should be sticky as well and reapply on rerun.

My nintendo switch ubuntu had a gamepad to mouse emulation.

alt for menu focus this has been removed due to bug reports, some players use alt for gameplay. While there is still an issue with alt and gameplay.

Henry-Hiles commented 2 weeks ago

write menubarFocusKey=alt into the settingsfile shown in the log

I would just do this with the menubar using a pc mouse on my phone. No my phone has android and the mouse works even there.

Also f11 on keyboard = fullscreen, that should be sticky as well and reapply on rerun.

My nintendo switch ubuntu had a gamepad to mouse emulation.

alt for menu focus this has been removed due to bug reports, some players use alt for gameplay. While there is still an issue with alt and gameplay.

Thank you, I dont currently have the hardware to plug a physical keyboard or mouse into my phone so I'll try this.

Henry-Hiles commented 2 weeks ago

write menubarFocusKey=alt into the settingsfile shown in the log

I would just do this with the menubar using a pc mouse on my phone. No my phone has android and the mouse works even there.

Also f11 on keyboard = fullscreen, that should be sticky as well and reapply on rerun.

My nintendo switch ubuntu had a gamepad to mouse emulation.

alt for menu focus this has been removed due to bug reports, some players use alt for gameplay. While there is still an issue with alt and gameplay.

Sorry, I can't see the log. Is there no fixed location for the config?

Henry-Hiles commented 2 weeks ago

Well I'm able to see some of the log Screenshot from 2024-10-29 11-02-29