- Home /
Mapping Android Media Key Codes To Unity
I am trying to connect one of our Unity games to an Android remote control. The remote is using these Android media keycodes:
[*] Select (D-Pad Center) KEYCODE_DPAD_CENTER
[*] Play/Pause KEYCODE_MEDIA_PLAY_PAUSE
[*] Rewind KEYCODE_MEDIA_REWIND
[*] Fast Forward KEYCODE_MEDIA_FAST_FORWARD
Is a mapping or plug-in available that routes Android media remote input to Unity KeyCodes or a similar interface?
Answer by jhample · Apr 23, 2014 at 06:22 AM
To add to the first answer here are some keycodes for the controller as well
Remote: Up- KeyCode.UpArrow Down- KeyCode.DownArrow Left- KeyCode.LeftArrow Right- KeyCode.DownArrow Center Button- KeyCode.JoystickButton0 Back Button- KeyCode.Escape Menu Button- KeyCode.Menu
Controller: Left stick- X axis- x axis Y axis- y axis Button- Keycode.JoystickButton8 Right stick- X axis- 3rd axis Y axis- 4th axis Button- Keycode.JoystickButton9 Dpad- X axis- 5th axis Y axis- 6th axis A- Keycode.JoystickButton0 B- Keycode.JoystickButton1 X- Keycode.JoystickButton2 Y- Keycode.JoystickButton3 L1- Keycode.JoystickButton4 R1- Keycode.JoystickButton5 L2- 13th axis R2- 12th axis Back Button- KeyCode.Escape Menu Button- KeyCode.Menu
Thanks but christ is that hard to read.
Remote:
Up- $$anonymous$$eyCode.UpArrow
Down- $$anonymous$$eyCode.DownArrow
Left- $$anonymous$$eyCode.LeftArrow
Right- $$anonymous$$eyCode.DownArrow
Center Button- $$anonymous$$eyCode.JoystickButton0
Back Button- $$anonymous$$eyCode.Escape
$$anonymous$$enu Button- $$anonymous$$eyCode.$$anonymous$$enu
Controller:
Left stick- (X axis = x axis) (Y axis = y axis)
L3 Button- $$anonymous$$eycode.JoystickButton8
Right stick- (X axis = 3rd axis) (Y axis = 4th axis)
R3 Button- $$anonymous$$eycode.JoystickButton9
Dpad- (X axis = 5th axis) (Y axis = 6th axis)
A- $$anonymous$$eycode.JoystickButton0
B- $$anonymous$$eycode.JoystickButton1
X- $$anonymous$$eycode.JoystickButton2
Y- $$anonymous$$eycode.JoystickButton3
L1- $$anonymous$$eycode.JoystickButton4
R1- $$anonymous$$eycode.JoystickButton5
L2- 13th axis
R2- 12th axis
Back Button- $$anonymous$$eyCode.Escape
$$anonymous$$enu Button- $$anonymous$$eyCode.$$anonymous$$enu
Answer by KevinCodes4Food · Apr 07, 2014 at 11:05 PM
I received this from Amazon technical support:
At the moment our FireTV Remote has the following mappings in Unity3D:
FireTV Button Unity KeyCode
Up Arrow KeyCode.UpArrow
Down Arrow KeyCode.DownArrow
Left Arrow KeyCode.LeftArrow
Right Arrow KeyCode.DownArrow
Center Button KeyCode.JoystickButton0
Back button KeyCode.Escape
Menu Button KeyCode.Menu
The following buttons are not mapped in Unity and would need a plugin developed to accept input:
Play/Pause
Rewind
Fast Forward
The following are system-wide buttons and would not be mapped in 3rd party applications:
Microphone
Home
Your answer
Follow this Question
Related Questions
All calls to Resources.Load stopped working on Amazon devices (Unity 5.6.3p3) 1 Answer
Setting up HTC One S for Unity Remote 1 Answer
Problem with Unity Remote for Android 2 Answers
Remote Gui Button only works on device if mouse is over the button in Unity editor 0 Answers
Unity Remote stopped working Android 1 Answer