bVNC单点触控分析

来源:互联网 发布:mp3播放软件 安卓 编辑:程序博客网 时间:2024/05/22 11:57

  1. //触屏模式
  2. SimulatedTouchpadInputHandler.onScroll {
  3.         RemotePointer p = canvas.getPointer();
  4.         final int action = e2.getActionMasked();
  5.         final int meta = e2.getMetaState();
  6.         
  7.         // TODO: This is a workaround for Android 4.2
  8.         //多手指检测
  9.         boolean twoFingers = false;
  10.         if (e1 != null)
  11.             twoFingers = (e1.getPointerCount() > 1);
  12.         if (e2 != null)
  13.             twoFingers = twoFingers || (e2.getPointerCount() > 1);

  14.         // onScroll called while scaling/swiping gesture is in effect. We ignore the event and pretend it was
  15.         // consumed. This prevents the mouse pointer from flailing around while we are scaling.
  16.         // Also, if one releases one finger slightly earlier than the other when scaling, it causes Android
  17.         // to stick a spiteful onScroll with a MASSIVE delta here.
  18.         // This would cause the mouse pointer to jump to another place suddenly.
  19.         // Hence, we ignore onScroll after scaling until we lift all pointers up.
  20.         // 多手指,滑动模式,缩放模式,缩放模式结束
  21.         if (twoFingers||inSwiping||inScaling||scalingJustFinished)
  22.             return true;

  23.         activity.showZoomer(true);

  24.         // If the gesture has just began, then don't allow a big delta to prevent
  25.         // pointer jumps at the start of scrolling.
  26.         if (!inScrolling) {
  27.             inScrolling = true;
  28.             distanceX = sign(distanceX);
  29.             distanceY = sign(distanceY);
  30.         } else {
  31.             // Make distanceX/Y display density independent.
  32.             distanceX = sensitivity * distanceX / displayDensity;
  33.             distanceY = sensitivity * distanceY / displayDensity;
  34.         }
  35.         
  36.         // Compute the absolute new mouse position on the remote site.
  37.         int newRemoteX = (int) (p.getX() + getDelta(-distanceX));
  38.         int newRemoteY = (int) (p.getY() + getDelta(-distanceY));
  39.         p.processPointerEvent(newRemoteX, newRemoteY, action, meta, false, false, false, false, 0);
  40.         canvas.panToMouse();
  41.         return true;
  42.     }
  43. //SimulatedTouchpadInputHandler.onScale(IBCScaleGestureDetector) line: 1
  44. //ScaleGestureDetector.onTouchEvent(MotionEvent) line: 258
  45. SimulatedTouchpadInputHandler(AbstractGestureInputHandler).onTouchEvent(MotionEvent)
  46. line: 460 {
  47.         //多点触控手势
  48.         scaleGestures.onTouchEvent(e);
  49.     //单点手势
  50.         return gestures.onTouchEvent(e);
  51.     }
  52. //SimulatedTouchpadInputHandler.onTouchEvent(MotionEvent) line: 1
  53. RemoteCanvasActivity.onTouchEvent(MotionEvent) line: 1217 {
  54.     try {
  55.         //activity检测到TouchEvent
  56.      return inputHandler.onTouchEvent(event);
  57.     } catch (NullPointerException e) { }
  58.     return false;
  59.     }

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(244) | 评论(0) | 转发(0) |
0

上一篇:bVNC多点触控分析

下一篇:linux rdp 共享剪贴板

相关热门文章
  • Android之开发环境搭建
  • Android自定义View的实现...
  • AndroidManifest.xml配置文件...
  • Android相对布局+圆角按钮+Sha...
  • 查看Android应用包名package和...
  • linux dhcp peizhi roc
  • 关于Unix文件的软链接
  • 求教这个命令什么意思,我是新...
  • sed -e "/grep/d" 是什么意思...
  • 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~