Missing KEYCODE_DPAD_CENTER in Andoid target
Monkey Forums/Monkey Bug Reports/Missing KEYCODE_DPAD_CENTER in Andoid target
| ||
http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_CENTER I've got Monkey working fine on the Nvidia Shield Android TV, but am missing the KEYCODE_DPAD_CENTER, because that is the "accept" key on the remote. I've tested putting it into the android gamepad handling section, and that works just fine. Change can be made in "targets\android_new\modules\native\androidgame.java" line 180: add: case 23: button=15;break; //CENTER(changed this to15 because it seems not to clash with ouya controls) It would also be great to have Android TV as an official target, the changes needed to adapt the current android_new target are very minor, and described here: http://www.monkey-x.com/Community/posts.php?topic=10376&post=116500 |
| ||
. |
| ||
If we could also have an additional "stick" to joystik , the dpad on the Nvidia Shield can be detected: See http://developer.android.com/reference/android/view/MotionEvent.html#AXIS_HAT_X for constants. in line 330, add the code below but, the _joyy[] and _joyx[] and maybe z as a dummy, needs to be redimensionend to hold 3 stics/pads. Also other adjustments in the other places where the code uses _joyx+y+z, and code that calls PollJoystick() . args1[0]=Integer.valueOf( 15 );g._joyx[2]=((Float)_getAxisValue.invoke( event,args1 )).floatValue(); args1[0]=Integer.valueOf( 16 );g._joyy[2]=((Float)_getAxisValue.invoke( event,args1 )).floatValue(); in inputdevice.monkey: Class JoyState Field joyx:Float[3] Field joyy:Float[3] Field joyz:Float[3] Field buttons:Bool[32] End |