The sources are: trackball joystick touchnavigation mouse keyboard touchscreen) swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen) press (Default: trackball ) roll <dx> <dy> (Default: trackball) root@android:/ # ?
:Camera::create(perspective, lookAt, vsg::ViewportState::create(VkExtent2D{ width, height }));}auto trackball = vsg::Trackball::create(camera, ellipsoidModel);trackball->addWindow(*window);viewer->addEventHandler (trackball);auto renderGraph = vsg::RenderGraph::create(window->windowAdapter);VkClearValue colorClear
可通过--pct-trackball参数来配置其事件百分比。 从Monkey执行该事件对外输出的日志可以看到: 该事件是由一系列的Trackball(ACTION_MOVE)事件组成的,观察手机上的操作,即为一系列的曲线滑动操作。 Sending Touch (ACTION_DOWN): 0:(608.0,610.0) :Sending Touch (ACTION_UP): 0:(609.2884,609.54736) :Sending Trackball (ACTION_MOVE): 0:(-3.0,4.0) :Sending Trackball (ACTION_MOVE): 0:(4.0,4.0) :Sending Touch (ACTION_DOWN Sending Touch (ACTION_DOWN): 0:(466.0,12.0) :Sending Touch (ACTION_UP): 0:(453.73657,10.844121) :Sending Trackball
GLUT_DOWN, GLUT_KEY_UP, GLUT_KEY_DOWN, GLUT_KEY_LEFT, GLUT_KEY_RIGHT import trackball = trackball.Trackball(theta = -25, distance=15) #当前鼠标位置 self.mouse_loc = None is not None: # 变化场景的角度 self.trackball.drag_to(self.mouse_loc[0], self.mouse_loc 下载trackball.py文件,并将其置于工作目录下: $ wget http://labfile.oss.aliyuncs.com/courses/561/trackball.py drag_to self.trackball.drag_to(self.mouse_loc[0], self.mouse_loc[1], dx, dy) 得到的旋转矩阵保存在viewer的trackball.matrix
Override public boolean onTrackballEvent(MotionEvent e) { mRenderer.mAngleX += e.getX() * TRACKBALL_SCALE_FACTOR ; mRenderer.mAngleY += e.getY() * TRACKBALL_SCALE_FACTOR; requestRender(); return GLSurfaceView { private final float TOUCH_SCALE_FACTOR = 180.0f / 320; private final float TRACKBALL_SCALE_FACTOR Override public boolean onTrackballEvent(MotionEvent e) { mRenderer.mAngleX += e.getX() * TRACKBALL_SCALE_FACTOR ; mRenderer.mAngleY += e.getY() * TRACKBALL_SCALE_FACTOR; requestRender(); return
我们将其附加如下(注意,我们正在附加到强加的边界): ModelViewer.Trackball trackball = new ModelViewer.Trackball(); myPerspectiveCamera.Transform = trackball.Transform; directionalLight.Transform = trackball.Transform; ... trackball.EventSource =
touchpad gamepad touchnavigation joystick touchscreen stylus trackball ) draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen) press (Default: trackball ) roll <dx> <dy> (Default: trackball) 比如输入 adb shell input text "hello world" 效果图 [在这里插入图片描述] *
Injection Failed :Sending Touch (ACTION_UP): 0:(492.16553,221.75143) // Injection Failed :Sending Trackball :Sending Trackball (ACTION_UP): 0:(0.0,0.0) :Sending Touch (ACTION_DOWN): 0:(462.0,51.0) :Sending Touch (ACTION_UP): 0:(377.56924,0.0) :Sending Trackball (ACTION_MOVE): 0:(1.0,-1.0) :Sending Touch (ACTION_DOWN Sending Touch (ACTION_DOWN): 0:(717.0,464.0) :Sending Touch (ACTION_UP): 0:(720.0,483.52737) :Sending Trackball (ACTION_MOVE): 0:(-4.0,3.0) :Sending Trackball (ACTION_UP): 0:(0.0,0.0) :Sending Touch (ACTION_DOWN
Sending Touch (ACTION_DOWN): 0:(838.0,113.0) :Sending Touch (ACTION_UP): 0:(852.82526,101.77225) ☀ --pct-trackball 事件 Sleeping for 0 milliseconds :Sending Trackball (ACTION_MOVE): 0:(1.0,4.0) :Sending Trackball 0ms wifi, 2042ms not connected)// Monkey finished ☀ Monkey 执行中断,在 log 的最后也能查看到当前大约已执行的次数 :Sending Trackball (ACTION_MOVE): 0:(-3.0,1.0):Sending Trackball (ACTION_MOVE): 0:(4.0,0.0) //[calendar_time:2018-04 -02 11:23:50.322 system_uptime:718998] // Sending event #7500:Sending Trackball (ACTION_MOVE): 0:
...]The sources are: mouse keyboard joystick touchnavigation touchpad trackball touchscreen) swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen) press (Default: trackball ) roll <dx> <dy> (Default: trackball)操作示例如下:- 模拟点击事件adb shell input tap x坐标 y坐标adb shell input tap
touchpad gamepad touchnavigation joystick touchscreen stylus trackball ) draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen) press (Default: trackball ) roll <dx> <dy> (Default: trackball) 比如输入 adb shell input text "hello world" 效果图 ?
18; 47 /** Key code constant: Directional Pad Up key. 48 * May also be synthesized from trackball 19; 50 /** Key code constant: Directional Pad Down key. 51 * May also be synthesized from trackball 20; 53 /** Key code constant: Directional Pad Left key. 54 * May also be synthesized from trackball ; 56 /** Key code constant: Directional Pad Right key. 57 * May also be synthesized from trackball 59 /** Key code constant: Directional Pad Center key. 60 * May also be synthesized from trackball
Override public boolean onTrackballEvent(MotionEvent e) { mRenderer.mAngleX += e.getX() * TRACKBALL_SCALE_FACTOR ; mRenderer.mAngleY += e.getY() * TRACKBALL_SCALE_FACTOR; requestRender(); return
Monkey是一个运行在模拟器或实际设备中的测试工具,他向系统发送伪随机的用户事件流,模拟用户触摸屏幕、滑动Trackball、 按键等操作来对设备上的程序进行压力测试。 --pct-trackball <percent> Adjust percentage of trackball events. (Trackball events consist of one or more random movements, sometimes followed by a click.)
kill-process-after-error] [–hprof] [–match-description TEXT] [–pct-touch PERCENT] [–pct-motion PERCENT] [–pct-trackball 提升触摸事件百分比80 adb shell monkey -p com.xueqiu.android -vv –pct-touch 80 100 –pct-motion 动作时间,滑动(直线) –pct-trackball
Toggle code profiling Alt-ENTER Toggle fullscreen mode F6 Toggle trackball mode DELETE Show trackball KEYPAD_5 DPad center KEYPAD_4
kill-process-after-error] [--hprof] [--pct-touch PERCENT] [--pct-motion PERCENT] [--pct-trackball com.tencent.mobileqq.activity.SplashActivity } in package com.tencent.mobileqqiSleeping for 0 milliseconds:Sending Trackball 开头控制事件百分比的参数,针对不通的测试类型可以调整百分比;图片有关事件参数说明如下(均表示百分比):参数说明--pct-touch PERCENT单击事件 --pct-motion PERCENT直线滑动事件--pct-trackball com.tencent.mobileqq.activity.SplashActivity } in package com.tencent.mobileqqiSleeping for 2000 milliseconds:Sending Trackball (ACTION_MOVE): 0:(-2.0,-3.0):Sending Trackball (ACTION_MOVE): 0:(-4.0,-4.0)Events injected: 3:Sending
kill-process-after-error] [--hprof] [--pct-touch PERCENT] [--pct-motion PERCENT] [--pct-trackball 毫秒之间不固定 pct 触摸事件百分比,即参数--pct-touch 滑动事件百分比,即参数--pct-motion 缩放事件百分比,即参数--pct-pinchzoom 轨迹球事件百分比,即参数--pct-trackball
border-box;"/>
用法:adb shell “monkey --pct-motion 100”
5、--pct-trackball 用法:adb shell “monkey --pct-trackball 100”
6、--pct-nav <percent>
作用:调整基本的导航事件百分比。
adb shell monkey --pct-motion 100 -v 10 注:常用参数,需注意的是移动事件是直线滑动,下面的trackball移动包含曲线移动。 ? --pct-trackball 调整轨迹事件的百分比(轨迹事件由一个或几个随机的移动组成,有时还伴随有点击)。 adb shell monkey --pct-trackball 100 -v 10 ?