Skip to content

Conversation

@kerryland
Copy link
Contributor

I wanted to be able to use a game controller (eg: Playstation 4) with the left and right bumpers to control the flippers. Now I can.

Note:

  • Bumping minSdkVersion to 9 was required to access KeyEvent.KEYCODE_BUTTON_L1. This means the app won't run on anything older than Gingerbread devices from about 2010. If that's a problem the keycodes could be replaced with their numeric literals.
  • The code that uses KEYCODE_BUTTON_A to start the game is not strictly required by the commit. It's actually a byproduct of removing the "START BUTTON" menu item in Now can see the tables when browsing them #179

@dozingcat
Copy link
Owner

This is great, thank you! (And sorry for the delay). Works well with my third-party Xbox controller.

I think it will be ok to keep minSdkVersion at 4; my understanding is that because KEYCODE_BUTTON_L1 is a static final field, it gets inlined rather than accessed at runtime.

@dozingcat dozingcat merged commit 1febc39 into dozingcat:master Jun 8, 2024
@kerryland kerryland deleted the R1_L1_for_flippers branch June 8, 2024 22:48
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

Successfully merging this pull request may close these issues.

2 participants