You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Connect a PS3 Guitar Hero controller to Android through USB OTG.
Open a controller-testing application.
Select standard Android Gamepad mode.
Press the red guitar fret.
Confirm that Android reports it as BUTTON_C.
Open Universal Mode.
Confirm that the same fret is detected as raw Button 3.
Launch Clone Hero through GameNative.
Open GameNative’s Physical Controller Bindings Editor.
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.
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Add raw controller input and support for
BUTTON_C, numbered buttons and specialised controllersSummary
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) 3Android 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 3when 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_CUniversal/raw mode:
Button 3PS 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-1for:KeyEvent.KEYCODE_BUTTON_CKeyEvent.KEYCODE_BUTTON_ZThe 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 axisSteps to reproduce
Connect a PS3 Guitar Hero controller to Android through USB OTG.
Open a controller-testing application.
Select standard Android Gamepad mode.
Press the red guitar fret.
Confirm that Android reports it as
BUTTON_C.Open Universal Mode.
Confirm that the same fret is detected as raw
Button 3.Launch Clone Hero through GameNative.
Open GameNative’s Physical Controller Bindings Editor.
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:
The editor could initially expose additional entries such as:
Suggested solution 2: Dynamic raw-input capture
A better general solution would be a “capture physical input” function:
The user selects an output such as Xbox A, keyboard A or R1.
GameNative displays “Press a controller button.”
The user presses any physical button.
GameNative records the received Android keycode or axis.
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:
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 modePlease allow raw axis detection and assignment in addition to button detection.
For example:
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_Cuses numeric keycode98, so a profile entry could potentially be represented as: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) 3Android detects the controller
Controller tester detects every input
GameNative detects and maps most controls
Red fret is unavailable because it is reported as
BUTTON_CGame 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.
Beta Was this translation helpful? Give feedback.
All reactions