Tuesday, December 28, 2010

[android-developers] Android Mouse/MotionEvent

Hi All,

It seems I am the first one to experiment on this, since I have got much reply to this. 

I tried to use the touch event, but it doest seem to work.

Please find my code snippet below:

Instrumentation inst = new Instrumentation();
        
long downTime = SystemClock.uptimeMillis();
        long eventTime = SystemClock.uptimeMillis();
        MotionEvent me = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_MOVE,
                (xy[0]+(xOffset*sensitivity)),(xy[1]+(yOffset*sensitivity)), 0);
        dispatchTrackballEvent(me);
        onTouchEvent(me);
        me.recycle();
inst.sendPointerSync(me);

I have tried both Instrumentation and dispatchTrackballEvent.  Nothing seems to work.  I am in a midsts of a deadline.  

Please, Any help is highly appreciated.

Thanks,
Ankur

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate