Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add raw controller input and support for BUTTON_C, numbered buttons and specialised controllers #1551

panprofes started this conversation in Ideas
Discussion options

Add raw controller input and support for BUTTON_C, numbered buttons and specialised controllers

Summary

I am using a PlayStation 3 Guitar Hero guitar controller with GameNative on Android.

The connected device is reported as:

GuitarHero for Playstation (R) 3 GuitarHero for Playstation (R) 3

Android detects the controller correctly. A controller-testing application detects all fret buttons, Start, Select, D-pad/strum input and the analog whammy bar.

GameNative can map almost all controls, but one fret is reported through the standard Android mapping as BUTTON_C. That input is not available in GameNative’s Physical Controller Bindings Editor and therefore cannot be forwarded to Clone Hero.

The same physical input is successfully detected as raw Button 3 when the controller tester uses Universal Mode.

I will attach screenshots showing all controller-test modes and mappings.

Main issue

The red fret is reported as:

  • Standard Android Gamepad mode: BUTTON_C

  • Universal/raw mode: Button 3

  • PS Mode Type 1: Circle

  • PS Mode Type 2: Cross/X

The physical button works correctly at the Android level, but GameNative does not allow it to be mapped.

In the GameNative source revision I inspected, ExternalController.getButtonIdxByKeyCode() explicitly returns -1 for:

  • KeyEvent.KEYCODE_BUTTON_C

  • KeyEvent.KEYCODE_BUTTON_Z

The current graphical bindings editor also focuses mainly on the standard Xbox-style button layout.

Complete controller mappings

Mode 1: Android Gamepad

Guitar control | Detected input -- | -- Green fret | B Red fret | C Yellow fret | A Blue fret | X Orange fret | Y Start | R2 Select | L2 Strum bar | D-pad Whammy bar | Right analog horizontal axis

Steps to reproduce

  1. Connect a PS3 Guitar Hero controller to Android through USB OTG.

  2. Open a controller-testing application.

  3. Select standard Android Gamepad mode.

  4. Press the red guitar fret.

  5. Confirm that Android reports it as BUTTON_C.

  6. Open Universal Mode.

  7. Confirm that the same fret is detected as raw Button 3.

  8. Launch Clone Hero through GameNative.

  9. Open GameNative’s Physical Controller Bindings Editor.

  10. Attempt to bind the red fret.

Actual behaviour

  • Android receives the input.

  • The controller tester receives the input.

  • Universal/raw mode identifies it as Button 3.

  • GameNative does not expose the physical input in its bindings editor.

  • Clone Hero therefore cannot bind the red fret.

  • Other standard guitar inputs can be mapped successfully.

Expected behaviour

GameNative should allow any button or axis detected by Android to be assigned to:

  • a virtual XInput/gamepad button;

  • a keyboard key;

  • a mouse input;

  • another GameNative action.

The solution should preferably not be limited specifically to Guitar Hero guitars.

Suggested solution 1: Add missing Android keycodes

Please add support for:

KeyEvent.KEYCODE_BUTTON_C
KeyEvent.KEYCODE_BUTTON_Z
KeyEvent.KEYCODE_BUTTON_1
KeyEvent.KEYCODE_BUTTON_2
KeyEvent.KEYCODE_BUTTON_3
KeyEvent.KEYCODE_BUTTON_4
KeyEvent.KEYCODE_BUTTON_5
KeyEvent.KEYCODE_BUTTON_6
KeyEvent.KEYCODE_BUTTON_7
KeyEvent.KEYCODE_BUTTON_8
KeyEvent.KEYCODE_BUTTON_9
KeyEvent.KEYCODE_BUTTON_10
KeyEvent.KEYCODE_BUTTON_11
KeyEvent.KEYCODE_BUTTON_12
KeyEvent.KEYCODE_BUTTON_13
KeyEvent.KEYCODE_BUTTON_14
KeyEvent.KEYCODE_BUTTON_15
KeyEvent.KEYCODE_BUTTON_16

The editor could initially expose additional entries such as:

ButtonConfig("C Button", KeyEvent.KEYCODE_BUTTON_C)
ButtonConfig("Z Button", KeyEvent.KEYCODE_BUTTON_Z)
ButtonConfig("Button 1", KeyEvent.KEYCODE_BUTTON_1)
ButtonConfig("Button 2", KeyEvent.KEYCODE_BUTTON_2)
ButtonConfig("Button 3", KeyEvent.KEYCODE_BUTTON_3)

Suggested solution 2: Dynamic raw-input capture

A better general solution would be a "capture physical input" function:

  1. The user selects an output such as Xbox A, keyboard A or R1.

  2. GameNative displays "Press a controller button."

  3. The user presses any physical button.

  4. GameNative records the received Android keycode or axis.

  5. The mapping is saved to the current controller profile.

This would avoid hardcoding every possible specialised controller layout.

The interface could display both the symbolic and numeric input:

BUTTON_C — Android keycode 98
BUTTON_3 — Android keycode 190
AXIS_Z
AXIS_HAT_X+

Suggested solution 3: Raw/universal controller mode

GameNative could provide a raw-input mode similar to the tester’s Universal Mode.

This mode would bypass predefined Android/PlayStation/Xbox layouts and expose:

  • all detected button numbers;

  • all detected Android keycodes;

  • all available analog axes;

  • positive and negative axis directions;

  • D-pad/hat inputs.

Axis support

The guitar also exposes:

  • Strum bar as D-pad input

  • Whammy bar as right-horizontal analog input or AXIS_Z, depending on the mapping mode

Please allow raw axis detection and assignment in addition to button detection.

For example:

AXIS_Z positive
AXIS_Z negative
AXIS_RX positive
AXIS_RX negative
AXIS_HAT_X positive
AXIS_HAT_X negative

Why this would be useful beyond Guitar Hero

This would improve GameNative compatibility with:

  • Guitar Hero guitars;

  • Rock Band guitars and drums;

  • arcade sticks;

  • dance pads;

  • steering wheels;

  • flight sticks;

  • retro USB adapters;

  • generic DirectInput controllers;

  • controllers with more than the standard Xbox button set.

Possible profile-level workaround

Controller profiles already store a physical Android keycode and a target binding.

For example, Android KEYCODE_BUTTON_C uses numeric keycode 98, so a profile entry could potentially be represented as:

{
 "keyCode": 98,
 "binding": "GAMEPAD_BUTTON_R1"
}

The current graphical editor does not provide a convenient way to create this mapping.

Environment

  • Android device

  • Controller connected through USB OTG

  • Controller: PS3 Guitar Hero guitar

  • Device name: GuitarHero for Playstation (R) 3 GuitarHero for Playstation (R) 3

  • Android detects the controller

  • Controller tester detects every input

  • GameNative detects and maps most controls

  • Red fret is unavailable because it is reported as BUTTON_C

  • Game tested: Clone Hero

Thank you for considering raw-input capture and broader controller-keycode support. This would make GameNative much more compatible with specialised USB controllers.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /