Skip to content
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

Android: Add more touchscreen buttons #13229

Open
Pantyhose-X opened this issue Feb 19, 2023 · 21 comments · May be fixed by #15845
Open

Android: Add more touchscreen buttons #13229

Pantyhose-X opened this issue Feb 19, 2023 · 21 comments · May be fixed by #15845
Labels
Android @ Client / Controls / Input Feature request Issues that request the addition or enhancement of a feature

Comments

@Pantyhose-X
Copy link
Contributor

Problem

Add virtual controls for easier operation

Solutions

Custom Controls https://www.youtube.com/watch?v=pNUYuymoiuA
image

@Pantyhose-X Pantyhose-X added the Feature request Issues that request the addition or enhancement of a feature label Feb 19, 2023
@Unacceptium
Copy link
Contributor

@grorp
Copy link
Member

grorp commented Sep 28, 2023

I have a branch with virtual button controls here: https://github.com/grorp/minetest/tree/the-good-stuff

screenshot

@Unacceptium
Copy link
Contributor

Unacceptium commented Sep 28, 2023

@grorp how to make it into an apk? i cannot find apk-s

@grorp
Copy link
Member

grorp commented Sep 28, 2023

@rubenwardy
Copy link
Contributor

What exactly does "virtual controls" mean? Is this the ability to customise the touchscreen GUI? Or do you want more onscreen buttons to emulate key presses

@rubenwardy rubenwardy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Sep 28, 2023
@Unacceptium
Copy link
Contributor

Unacceptium commented Sep 28, 2023

actually all makes a mixture of whats needed, like we need more buttons and ability to use most of them at once,(like aux+sneak etc) but minimal customization surely needed. virtual controls mean you place and drag the buttons or sliders anywhere. all can be placed by player anywhere they wants!
sorry for bad english

@rubenwardy rubenwardy changed the title Android:Virtual Controls Android: Ability to customise controls Sep 28, 2023
@grorp grorp removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Sep 30, 2023
@thepwds
Copy link

thepwds commented Sep 30, 2023

This looks really nice, hope it gets into Minetest 5.8.0. The mobile controls have always been difficult for me

@thepwds

This comment was marked as off-topic.

@tetsuo55
Copy link

tetsuo55 commented Nov 2, 2023

I have a branch with virtual button controls here: https://github.com/grorp/minetest/tree/the-good-stuff

screenshot

Using this build when flying below the island of the end in creative mode in mineclone2 the flights controls stop working and I fall into the abyss

@tetsuo55
Copy link

tetsuo55 commented Nov 2, 2023

@tetsuo55 what the frick? can you make a video about that?

Ok I will do it as soon as I am able to.

Also this is the only build where (cross)bow and arrow works on mineclone2

@tetsuo55
Copy link

tetsuo55 commented Nov 6, 2023

@tetsuo55 i tried that thing and does not happen for me. i flew below end islands and everything is ok. Please mind that sneak button is not a button! its a switch/toogle! if thats the problem, just press it again!

You're right , sneak being a toggle it forces you down while in flight mode until you press it again.

However shields still can't be used because the button for it appears under the directional controls

Edit: shield working fine

@grorp

This comment was marked as off-topic.

@tetsuo55

This comment was marked as off-topic.

@tetsuo55

This comment was marked as off-topic.

@tetsuo55

This comment was marked as off-topic.

@Unacceptium
Copy link
Contributor

Unacceptium commented Nov 7, 2023

theres so much similarity between @grorp 's fork and Minecrap new controls...
Screenshot_20231107_193243
Screenshot_20231107_193526

also, Minecrap got Virtual Controls!!
Screenshot_20231107_191901
(offtopic part:when i played mc a minute ago, after years of only mt play, i got so much nostalgia!)

@AdityaMH
Copy link

AdityaMH commented Mar 8, 2024

still in development?

@grorp
Copy link
Member

grorp commented Mar 12, 2024

I'm moving the "allow customizing the button layout" part of this issue to #14456, since the other issue is more clear.

This one can stay open for the "add more on-screen buttons" part.

@grorp grorp changed the title Android: Ability to customise controls Android: Add more touchscreen buttons Mar 12, 2024
@AdityaMH
Copy link

AdityaMH commented Mar 13, 2024

one more annoying thing is, there no attack/interact switch button (most touchscreen device need) or attack/switch button (this only for using crosshair, still hard to imagine) in Android. since pc can press physical keyboard.

@ghost
Copy link

ghost commented Jul 31, 2024

The control buttons + analog joysticks in the op video seem to be from the project https://github.com/strato-emu/strato

@maplemedley
Copy link
Contributor

maplemedley commented Feb 15, 2025

Now that an editor has been implemented thanks to grorp this will probably be easier!

I'm not experienced with the formspec, but I imagine it would be possible to give the player the ability to add any keybinding with something like a new "other buttons" button in the "Add button" menu of #14933. This could open up a clickable list of the Luanti keybindings, taken directly from the internal keybindings if possible (to reduce maintenance need and make any binding possible).

I agree with @AdityaMH, I think the option to have separate attack/interact buttons would be useful for many, which is why I think the best solution would be for the customizer to be rounded out with the option to add any internal keybinding. Allowing any keybinding to be added would broadly make it easier for people to customize things to their need, like with #14388, by making a DPAD with the arrow buttons. Displaying them could be as simple as just showing the first few letters of the binding name, since they would be nonstandard bindings, like is done for Aux1, textures can be filled in later.


Edit:
I don't have the time to look more into it right now, but if anyone else does; I think getting a list of real keybindings (I'm thinking the ones used for player movement, not the formspec, so in KeyCache) is doable by looping over inputhandler.cpp's key member after its populated with populate(), and then getting their names by referring to their m_name member.

Regardless of if inputhandler is used as a singleton it seems like it shouldn't be a problem to create a new inputhandler object just to populate it and use its key list to get its KeyPress objects. It can be looped over with for (size_t i=0; i < KeyType::INTERNAL_ENUM_COUNT; i++)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android @ Client / Controls / Input Feature request Issues that request the addition or enhancement of a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants