2018年在弄的时候,有遇到这种问题,使用了很多GALV的屏幕按钮插件等等,在安卓下玩,非常卡顿
后来在论坛遇到有大佬解决了这种,使用了Eclipse安卓和安卓studio编写代码解决安卓虚拟按键问题,我在那个群里找到一段相关代码
case MotionEvent.ACTION_MOVE:
if(v==Direction){
Log.e("ACTIVITY_TAG", "X=."+vx);
Log.e("ACTIVITY_TAG", "Y=."+vy);
if((vx>0)&&(Math.abs(vy)<Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction1);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
false;Input._currentState['right'] = true;Input._currentState['up'] = false;Input._currentState['down'] =
false;");
}
if((vx<=0)&&(Math.abs(vy)<Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction2);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
true;Input._currentState['right'] = false;Input._currentState['up'] = false;Input._currentState['down'] =
false;");
}
if((vy<=0)&&(Math.abs(vy)>=Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction3);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
false;Input._currentState['right'] = false;Input._currentState['up'] = true;Input._currentState['down'] =
false;");
}
if((vy>0)&&(Math.abs(vy)>=Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction4);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
false;Input._currentState['right'] = false;Input._currentState['up'] = false;Input._currentState['down'] =
true;");
}
}
break;
使用的是安卓编程浏览器的调用函数功能,我后来是研究如何把这段代码运用到中文编程易安卓
最近我电脑无意翻到了这些以前资料,因为我不玩很久了,所以分享这个易安卓源码,给需要用到安卓虚拟按键问题的网友提供一个思路吧
源码 https://www.123pan.com/s/w0A8Vv-bfHoH.html提取码:wXPI
打开源码的软件
易安卓软件破解版 https://www.123pan.com/s/w0A8Vv-ZfHoH.html提取码:Uigo
备份地址 https://cloud.189.cn/web/share?code=bAzmiq2Iziyi(访问码:hle5)
易安卓软件打开会有登录失败,主要是破解版,破掉后台,无视进入,如果要更新,请取消
后来在论坛遇到有大佬解决了这种,使用了Eclipse安卓和安卓studio编写代码解决安卓虚拟按键问题,我在那个群里找到一段相关代码
case MotionEvent.ACTION_MOVE:
if(v==Direction){
Log.e("ACTIVITY_TAG", "X=."+vx);
Log.e("ACTIVITY_TAG", "Y=."+vy);
if((vx>0)&&(Math.abs(vy)<Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction1);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
false;Input._currentState['right'] = true;Input._currentState['up'] = false;Input._currentState['down'] =
false;");
}
if((vx<=0)&&(Math.abs(vy)<Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction2);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
true;Input._currentState['right'] = false;Input._currentState['up'] = false;Input._currentState['down'] =
false;");
}
if((vy<=0)&&(Math.abs(vy)>=Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction3);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
false;Input._currentState['right'] = false;Input._currentState['up'] = true;Input._currentState['down'] =
false;");
}
if((vy>0)&&(Math.abs(vy)>=Math.abs(vx))){
Direction.setBackgroundResource(R.drawable.direction4);
Log.e("ACTIVITY_TAG", "OK.");
MainActivity.this.mXWalkView.loadUrl("javascript:Input._currentState['left'] =
false;Input._currentState['right'] = false;Input._currentState['up'] = false;Input._currentState['down'] =
true;");
}
}
break;
使用的是安卓编程浏览器的调用函数功能,我后来是研究如何把这段代码运用到中文编程易安卓
最近我电脑无意翻到了这些以前资料,因为我不玩很久了,所以分享这个易安卓源码,给需要用到安卓虚拟按键问题的网友提供一个思路吧
源码 https://www.123pan.com/s/w0A8Vv-bfHoH.html提取码:wXPI
打开源码的软件
易安卓软件破解版 https://www.123pan.com/s/w0A8Vv-ZfHoH.html提取码:Uigo
备份地址 https://cloud.189.cn/web/share?code=bAzmiq2Iziyi(访问码:hle5)
易安卓软件打开会有登录失败,主要是破解版,破掉后台,无视进入,如果要更新,请取消