According to this website https://developer.android.com/training/game-controllers/multiple-controllers.html , Android seems to support multiple gamepads. Actually, it doesn't work when multiple input device event is occurred simultaneously. for example when player1 and player2 push the up button simultaneously, dipathKeyEvents are happened like below.
D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_UP,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP
And device:6's ACTION_UP is never happened.
They should be like this
D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP
Are there anyone who can manage multiple controller? Does NativeActivity resolve this problem?
My environment is
- device: NVIDIA Shield TV
- controller1: Shield controller
- controller2: Playstation 3 controller connect via USB
- OS: Android TV