monkeyswarm / MobMuPlat

MobMuPlat is an iOS & Android app to host PureData patches with custom visual interfaces and hardware access.
www.mobmuplat.com
Other
182 stars 25 forks source link

Gamepad keys still controlling android UI #89

Open theRealCarneiro opened 1 year ago

theRealCarneiro commented 1 year ago

The gamepad buttons continue to be transmitted to the Android device, resulting in their unintended control over the user interface. Consequently, certain keys become unusable. It is unclear whether this issue is exclusive to my Android device, but as an example, the B key is currently set to exit an application, while the select key brings up the app selection menu.

From what I understand, this is happening because https://github.com/monkeyswarm/MobMuPlat/blob/f6ff11375da362e176398a64f53ca69b6157a27b/MobMuPlat-Android/app/src/main/java/com/iglesiaintermedia/mobmuplat/InputDeviceState.java#L94 https://github.com/monkeyswarm/MobMuPlat/blob/f6ff11375da362e176398a64f53ca69b6157a27b/MobMuPlat-Android/app/src/main/java/com/iglesiaintermedia/mobmuplat/MainActivity.java#L1486

The current implementation of the OnKeyDown and OnKeyUp methods includes a call to super.OnKeyDown, resulting in the transmission of the button inputs to the Android device. However, according to the Amazon guide on handling controllers in apps, the call to super.OnKeyDown should only be made if the key has not been handled within the app. This approach ensures that the controller inputs are processed within the app and prevent unintended effects on the overall UI functionality.