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

Touch input does not work on android #76

Open
Hellzbellz123 opened this issue Sep 22, 2023 · 4 comments
Open

Touch input does not work on android #76

Hellzbellz123 opened this issue Sep 22, 2023 · 4 comments

Comments

@Hellzbellz123
Copy link

my games menus do not work on android, the highlight function works but none the the press events are detected.

the party editor example exhibits the same behavior

@Hellzbellz123
Copy link
Author

did some digging and it seems like there is an issue with the cursor position and UiScale component,
i updated the function too handle it the same way bevy did and it seems too make my cursor work, but touch events still do not work
gonna keep at it

@jkb0o
Copy link
Owner

jkb0o commented Sep 25, 2023

Hello there! Thank you for your interest to the project! Unfortunately I have no resources for diving into android because of #77. I'm very sorry.

I believe the problem is somewhere in input_system https://github.com/jkb0o/belly/blob/main/crates/belly_core/src/input.rs#L186. Looking forward to your investigation and hope it may lead to the PR.

@Hellzbellz123
Copy link
Author

I didn't fix it per se, but it seems like touch inputs where only triggering PointerInput::Down events, not pressed events, I extended the button widget too handle them and it started working,
I also changed how the cursor position / touch position were grabbed, atm the ui will only support 1 touch, which is not really viable for release but it does make it work. I figure I can probably wrap the whole input system in an iterator over touches. However, I think I'd rather just split it into it's own system before I do that.

I saw the work on polako, I am looking forward too what it ends up looking like. I do like how the current styling and html layout works but I do understand the issues with them.

@Hellzbellz123
Copy link
Author

Like a bad coder I changed two things at once and it started working so I'm not sure which it actually was, I plan on going back and testing too figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants