REGoth-project / REGoth

OpenSource-Reimplementation of the zEngine, used by the game "Gothic"
GNU General Public License v3.0
630 stars 63 forks source link

[Android] Taps are not recognized #298

Closed ChaosMarc closed 6 years ago

ChaosMarc commented 6 years ago

Samsung Galaxy S5 / LineageOS 14.1 (latest nightly) / Android 7.1.2

After downloading and extracting the demo or using my installed desktop game files I can launch to the Main Menu but cannot do anything there. The documentation https://github.com/REGoth-project/REGoth/wiki/Android-App tells me to tap in the upper left quadrant to simulate "Enter" but nothing happens. Tapping on other areas does nothing at all, too.

I can see the Android notification bar in front of the main menu at all times and by tipping on it the nofication center drops into view. I guess the app is not completely in full screen so my taps are not recognized.

screenshot_20171024-110936

ataulien commented 6 years ago

I can see the Android notification bar in front of the main menu at all times and by tipping on it the nofication center drops into view. I guess the app is not completely in full screen so my taps are not recognized.

This is known behavior. It does that for me too, but the input works fine.

Are you able to compile the android version yourself? We could put some logging to see whether input is registered at all...

ChaosMarc commented 6 years ago

I just set up my android dev environment. compiling and installing works.

ataulien commented 6 years ago

Cool! In the newer versions of android studio, you can even set breakpoints in native code!

PlatformAndroid.cpp, line 273 onwards (beware, that file is not very pretty):

                        if(x < getWindowWidth() / 2)
                        {
                            keyEvent(ACTION_PlayerAction, 0, KEY_ACTION_PRESS, 0);
                        } else
                        {
                            keyEvent(ACTION_Escape, 0, KEY_ACTION_PRESS, 0);
                        }

do these ever get called?

If breakpoints do not work, you can also put a LogInfo() << "My Message"; there

ChaosMarc commented 6 years ago

Thanks for the direction. breakpoints are working fine

In line 190 the expression AInputEvent_getSource(event) evaluates to {int}20482 so the case AINPUT_SOURCE_TOUCHSCREEN (which evaluates to {int}4096) is not true.

found a fix for it: https://github.com/SFML/SFML/issues/953 I will create a PR