根据https://developer.android.com/training/game-controllers/multiple-controllers.html,Android似乎支持多个游戏手柄。实际上,当同时发生多个输入设备事件时并不起作用。例如,当玩家1和玩家2同时按下向上按钮时,dipathKeyEvents会像下面这样发生。
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
并且设备6的ACTION_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 D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP
有人能够管理多个控制器吗? NativeActivity解决了这个问题吗?
我的环境是
- 设备:NVIDIA Shield电视 - 控制器1:Shield controller - 控制器2:通过USB连接的Playstation 3控制器 - 操作系统:Android TV
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
并且设备6的ACTION_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 D/dispatchKeyEvent(12736): device:6,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP D/dispatchKeyEvent(12736): device:1,action:ACTION_DOWN,keyCoe:KEYCODE_DPAD_UP
有人能够管理多个控制器吗? NativeActivity解决了这个问题吗?
我的环境是
- 设备:NVIDIA Shield电视 - 控制器1:Shield controller - 控制器2:通过USB连接的Playstation 3控制器 - 操作系统:Android TV